[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: radial gaussian distribution
From: |
Ted Harding |
Subject: |
RE: radial gaussian distribution |
Date: |
Tue, 20 Sep 2005 13:35:10 +0100 (BST) |
On 20-Sep-05 roberto wrote:
> Hello,
> i have to generate a gaussian distribution of points which depends
> only on the distance from a fixed point O, that is i need a radial
> gaussian distribution;
> may it be useful the definition of the function used in the following:
>
> http://octave.sourceforge.net/index/f/erf_Z.html
>
> ??
> if possible address me to some documentation useful
>
> thank you for any help
> --
> roberto
Your question is somewhat under-specified. The following may help
to clarify, and may even contain the solution!
If you want a bivariate gaussian distribution (i.e. (X,Y) are
jointly gaussian) where the probability density depends only
on the distance r = sqrt((x-x0)^2 + (y-y0)^2) from a fixed
point (x0,y0), then you are in fact dealing with a "circular"
(or, in 3 dimensions, "spherical", etc.) gaussian distribution.
Because of the properties of the gaussian probability density
function (which is what I see specified as Z() in the URL you
give, as opposed to the definition of erf(), by the way), this
will be achieved if (X-x0) and (Y-y0) are independent gaussian
variates with identical variances.
So, if 's' is the marginal standard deviation of either X or Y
(i.e. s^2 is the variance),
[x0 + s*randn(N,1) y0 + s*randn(N,1)]
will generate a matrix of N rows, each with 2 elements(X,Y)
where X and Y are independent, each with variance s^2, with
X centred on x0 and Y on y0, so that the centre of (X,Y is
(x0,y0) and their joint distrubution is centred on (x0,y0).
An exactly analogous procedure will work for more than 2
dimensions, e.g.
[x0 + s*randn(N,1) y0 + s*randn(N,1) z0 + s*randn(N,1)]
Hoping this helps,
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 20-Sep-05 Time: 13:13:29
------------------------------ XFMail ------------------------------
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------