Thread View: sci.math.num-analysis
5 messages
5 total messages
Started by Mohamed Jenu M Z
Wed, 30 Sep 1992 10:31
2D random numbers
Author: Mohamed Jenu M Z
Date: Wed, 30 Sep 1992 10:31
Date: Wed, 30 Sep 1992 10:31
11 lines
634 bytes
634 bytes
Hi netters, Is it ok to generate a 2D Gaussian distribution (mean 0 and variance 1) pseudorandom numbers from a 1D pseudorandom numbers (Gaussian, mean 0, variance 1) by arranging them into rows and columns? Any advice is greatly appreciated. Jenu jenum@ossparc.essex.ac.uk
Re: 2D random numbers
Author: Gideon A Fraenkel
Date: Wed, 30 Sep 1992 13:09
Date: Wed, 30 Sep 1992 13:09
26 lines
1531 bytes
1531 bytes
In article <3638.9209301031@rfsparc.essex.ac.uk> jenum@essex.ac.uk (Mohamed Jenu M Z) writes:
>
>Hi netters,
>
>Is it ok to generate a 2D Gaussian distribution (mean 0 and variance 1)
>pseudorandom numbers from a 1D pseudorandom numbers (Gaussian, mean 0,
>variance 1) by arranging them into rows and columns? Any advice is
>greatly appreciated.
>
>Jenu
>
>jenum@ossparc.essex.ac.uk
What about the 2D distribution is supposed to be Gaussian? If it's
the norm -- the distance from the origin -- , then the answer to your
question is no. In general, the distribution of a function f(x,y) is
calculated as
/
P(z) = | delta(z-f(x,y)) P(x)P(y) dxdy .
/
You can see that if x and y are Gaussian, then P(z) will be
proportional to z times a Gaussian, which among other things goes to
zero at the origin. If you do want z to be normal, you could just
choose it, and then set the azimuth to a number flatly distributed
from 0 to 2pi. What actually do you want?
Re: 2D random numbers
Author: David Kastrup
Date: Thu, 01 Oct 1992 00:11
Date: Thu, 01 Oct 1992 00:11
33 lines
1955 bytes
1955 bytes
gfraenke@magnus.acs.ohio-state.edu (Gideon A Fraenkel) writes: >In article <3638.9209301031@rfsparc.essex.ac.uk> jenum@essex.ac.uk (Mohamed Jenu M Z) writes: >> >>Hi netters, >> >>Is it ok to generate a 2D Gaussian distribution (mean 0 and variance 1) >>pseudorandom numbers from a 1D pseudorandom numbers (Gaussian, mean 0, >>variance 1) by arranging them into rows and columns? Any advice is >>greatly appreciated. >> >>Jenu >> >>jenum@ossparc.essex.ac.uk >What about the 2D distribution is supposed to be Gaussian? If it's >the norm -- the distance from the origin -- , then the answer to your >question is no. In general, the distribution of a function f(x,y) is >calculated as > / > P(z) = | delta(z-f(x,y)) P(x)P(y) dxdy . > / >You can see that if x and y are Gaussian, then P(z) will be >proportional to z times a Gaussian, which among other things goes to >zero at the origin. A two-dimensional Gaussian has probability just like usual Gaussian: 1/(variance * sqrt(2pi)) exp(-(x-mean)^2/(2 variance^2)), only that mean and x are vectors, and their sqauring is a simple dot product. So you can use 1D Gaussians perfectly, since something like exp(-x^2-y^2) can be split into exp(-x^2)exp(-y^2) without problem. Apart from the post before being wrong (considering Gaussians definition), I do not understand it. Too bad.
Re: 2D random numbers
Author: dch
Date: Thu, 01 Oct 1992 10:31
Date: Thu, 01 Oct 1992 10:31
13 lines
1104 bytes
1104 bytes
In article <3638.9209301031@rfsparc.essex.ac.uk> jenum@essex.ac.uk (Mohamed Jenu M Z) writes:
>
>Is it ok to generate a 2D Gaussian distribution (mean 0 and variance 1)
>pseudorandom numbers from a 1D pseudorandom numbers (Gaussian, mean 0,
>variance 1) by arranging them into rows and columns?
>
Since you want pairs of random numbers, you may find it more efficient to use the Box-Muller
scheme:
x = sqrt(-2 log xi) cos(2 pi eta), y = sqrt(-2 log xi) sin(2 pi eta),
where xi, eta are successive pseudorandom numbers uniformly distributed on (0,1).
(- unless you already have a more efficient Gaussian generator available)
David Handscomb (dch@comlab.ox.ac.uk)
Re: 2D random numbers
Author: BARTHOLDI Paul
Date: Fri, 02 Oct 1992 15:03
Date: Fri, 02 Oct 1992 15:03
16 lines
1172 bytes
1172 bytes
|> > .... |> Since you want pairs of random numbers, you may find it more efficient to use the Box-Muller |> scheme: |> x = sqrt(-2 log xi) cos(2 pi eta), y = sqrt(-2 log xi) sin(2 pi eta), |> where xi, eta are successive pseudorandom numbers uniformly distributed on (0,1). |> (- unless you already have a more efficient Gaussian generator available) |> |> David Handscomb (dch@comlab.ox.ac.uk) There is a variant where you can also use the correlation between x and y, but I can't find it back (shurely very easy to find, but ...) If any one has it, could you post it too ? Thanks. Paul Bartholdi (bartho@obs.unige.ch)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads