Hi all,
When using the ZigguratGaussian Distribution function for simulating noise on a communication channel I noticed a correlation between the random numbers.
First, I generated 10,000 points in the following way (x- and y-coordinates are generated in the same for loop):
ZigguratGaussianSampler ZGS = new ZigguratGaussianSampler(5);
double[] data_x = new double[10000];
double[] data_y = new double[10000];
for (int ix = 1; ix < 10000; ix++ ) {
data_x[ix] = ZGS.NextSample(50.0, 10.0);
data_y[ix] = ZGS.NextSample(50.0, 10.0);
}
// Matlab >> plot(data_x, data_y, "linestyle","none", "marker", "x");
This results in the following distribution:
There is a kind of pattern inside the "random numbers".
Next I generated the same values in separate for-loops:
ZigguratGaussianSampler ZGS = new ZigguratGaussianSampler(5);
double[] data_x = new double[10000];
double[] data_y = new double[10000];
for (int ix = 1; ix < 10000; ix++ ) {
data_x[ix] = ZGS.NextSample(50.0, 10.0);
}
for (int ix = 1; ix < 10000; ix++) {
data_y[ix] = ZGS.NextSample(50.0, 10.0);
}
// Matlab >> plot(data_x, data_y, "linestyle","none", "marker", "x");
The values now “seem” to be Gaussian distributed:
For me it looks like a bug in the ZigguratGaussianSampler. The created numbers are somehow correlated and not really random. Is this a bug or a feature?
Regards,
Nils