I want to generate a collection of 1000 points (x, y), at (near) origin with their density following a Gaussian distribution on both X and Y axes. The full width half maxima (FWHM) of this Gaussian distribution should be a variable, say 5 to start with.
In NormalDistribution[0, 1], first variable is the position of the Gaussian peak, defined as mean in Mathematica. However, I am not able to figure out the fact that how the second variable, which is defined as “deviation” in Mathematica, is related to FWHM ? Can you please elaborate that how the number “1” chosen by you is equivalent to the FWHM of 5.
FWHM - Is a measure of the width of the peak. abbreviation of Full width at half maxima. Trying to figure out how the “standard deviation” is related to FWHM !!
So that you know while using FWHM as a parameter to characterize the Normal (i.e., Gaussian) distribution is legitimate, it is not a very common way of doing so (but maybe the standard in some specialized fields). Typically one uses the mean and variance or mean and standard deviation. Mathematica uses the mean and standard deviation.
For a Normal distribution (and only for a Normal distribution) the standard deviation is given by
Because if your point-denisity (number of points per unit area) is rho = Exp[ -a x^2 ] (something like a normal distribution (?), at least half ), x being the distance from the origin, then the number of points in the ring of area 2 Pi x deltax is 2 Pi x deltax rho, and this is zero at the origin and has a peak somewhere.
I counted the number of points in such areas ( in the Table, using Select) and plotted it against distance. The result could be well fitted by a rho like that given above.
I think what you’ve given the OP is the distribution of the “distance” from the origin and I don’t think that’s what’s being asked. 0.25 is approximately where the PDF of the distance has a maximum (although I’d say it’s closer to 0.3 for the example you gave):
OP is for “original poster”. In other words, a reference to the person who asked the question or to the question being asked.
Your initial response did contain the what was asked for: how to generate the sample points. Your other response described the distribution of the distance of those points from (0,0) and I don’t see that the OP asked for that.
Thanks, I get your point mathematically. However, if we are using a function under RandomReal which has a peak at zero, why don’t we have the highest density at origin. Can we modify the NormalDistribution in such a way (or use any other function) that can give highest density of points at origin. Because, that is what I need in the end.
You do get a peak of the density of points at the origin. The density of points for a bivariate normal distribution with mean vector (0,0) does have a peak at (0,0).
Hans introduced the distribution of the “distance” from the origin which doesn’t seem to have anything to do with your question. The peak around 0.3 mentioned by Hans is the peak of the probability density function of the “distance from (0,0)” which is a univariate distribution. And that, again, is an interesting distribution but does not appear to me to something that you were asking about.
So no need to modify the Normal distribution. You can get a set of data points with the origin at (0,0) (and therefore the highest density of sample points near the origin) from two independent normal random variables in several ways. Here are 2:
sd = 5/(2 Sqrt[2 Log[2]]);
data = RandomVariate[NormalDistribution[0, sd], {500, 2}];
data = RandomVariate[BinormalDistribution[{0, 0}, {sd, sd}, 0], 500];
Thanks a lot. But the example you provided above, was giving a peak at 0.3 for normal distribution NormalDistribution[0, 0.3]. How that is possible. And what is the difference RandomVariate makes.
The function to obtain random samples from a specified distribution is RandomVariate. Hans used RandomReal. But while that appears to work, the documentation does not mention that RandomReal should work that way.