# Thread: Time steps in diffusion kernel

1. ## Time steps in diffusion kernel

Hi,

I am new to this forum and I am not quite sure if my question belongs to this
subforum. Anyway..what I have so far is a so called dispersal kernel of animals.
It is a diffusion curve (like Gaussian) which discribes the spread of an animal

In my special case it is a function of two superimposed normal distributions.
$\displaystyle F(x)=p*\frac{1}{\sqrt{2\pi\sigma_{1}^2}}*e^{-\frac{(x-\mu)^2}{2\sigma_{1}^2}}+(1-p)*\frac{1}{\sqrt{2\pi\sigma_{2}^2}}*e^{-\frac{(x-\mu)^2}{2\sigma_{2}^2}}$

The function gives the distribution of spread after time one time step. The second time step is based on the result (density) of the first time step. So actually on each point of the curve the diffusion is applied again for the second time step and then all curves are added up to get the new distribution. So after each time step the curve will flatten out but will always cover an area of 1 below the curve. Is that clear and correct so far?

Now my question is: How such and equation be written in mathematical terms so that if I have all the curve parameters I can calculate new curves for the time steps I am interested in?

Hopefully someone can help me with that....

Best regards,
Johannes

PS: Usually I am using Python and Scipy for solving equation etc. in any case if that information is needed....

2. ## Re: Time steps in diffusion kernel

Originally Posted by sinnfluter
Hi,

I am new to this forum and I am not quite sure if my question belongs to this
subforum. Anyway..what I have so far is a so called dispersal kernel of animals.
It is a diffusion curve (like Gaussian) which discribes the spread of an animal

In my special case it is a function of two superimposed normal distributions.
$\displaystyle F(x)=p*\frac{1}{\sqrt{2\pi\sigma_{1}^2}}*e^{-\frac{(x-\mu)^2}{2\sigma_{1}^2}}+(1-p)*\frac{1}{\sqrt{2\pi\sigma_{2}^2}}*e^{-\frac{(x-\mu)^2}{2\sigma_{2}^2}}$

The function gives the distribution of spread after time one time step. The second time step is based on the result (density) of the first time step. So actually on each point of the curve the diffusion is applied again for the second time step and then all curves are added up to get the new distribution. So after each time step the curve will flatten out but will always cover an area of 1 below the curve. Is that clear and correct so far?

Now my question is: How such and equation be written in mathematical terms so that if I have all the curve parameters I can calculate new curves for the time steps I am interested in?

Hopefully someone can help me with that....

Best regards,
Johannes

PS: Usually I am using Python and Scipy for solving equation etc. in any case if that information is needed....
The distribution at epoch n+1 should be the convolution of the distribution at epoch n and your kernel F.

CB

3. ## Re: Time steps in diffusion kernel

Thank you for that tip. I think convolution is the operation a was
looking for where:
$\displaystyle f(x) = g(x)$ for the first step and
$\displaystyle f(x) = f(x) * g(x)$ for the second step and so on

If I am right that should result in a probability density function
that has again an area of 1 below?!

Especially this page illustrated well what I was looking for (1 D application)
Spatial convolution

Anyway, I have to try now to use that function in pyhton/scipy to
get a resulting plot I can further examine. If anyone is familiar with
that, it'd be great help to me...

Best regards,
johannes

PS: Is that the correct subforum? Otherwise it should be moved...

4. ## Re: Time steps in diffusion kernel

Originally Posted by sinnfluter
Thank you for that tip. I think convolution is the operation a was
looking for where:
$\displaystyle f(x) = g(x)$ for the first step and
$\displaystyle f(x) = f(x) * g(x)$ for the second step and so on

If I am right that should result in a probability density function
that has again an area of 1 below?!

Especially this page illustrated well what I was looking for (1 D application)
Spatial convolution

Anyway, I have to try now to use that function in pyhton/scipy to
get a resulting plot I can further examine. If anyone is familiar with
that, it'd be great help to me...

Best regards,
johannes

PS: Is that the correct subforum? Otherwise it should be moved...
If you have to do the convolutions nummerically you might want to do them using the fast Fourier transform.

I will move this to the Advanced Applied area

CB

5. ## Re: Time steps in diffusion kernel

Hi again,

just some additional information to the convolution of distribution kernels:
So far as I understand is the resulting variance of a convoluted normal distribution the sum of the variance of the single distributions. I am not
sure but thats what I interpret from here: http://kdbio.inesc-id.pt/~svinga/ren...ion_normal.pdf

Does anyone know a source of a scientific math paper (beside the supplementary material stated above) that gives the mathematical proof of that?

Best regards,
Johannes