From: Justus P. <Jus...@UL...> - 2004-11-08 15:11:02
|
> I can't regenerate this problem with octave-forge CVS or with 2004.09.09. > I used the commands > > octave:1> hist(randn(1,1e6),-3.75:0.5:3.75) > octave:2> var(randn(1,1e6)) > ans =3D 1.0001 > octave:3> mean(randn(1,1e6)) > ans =3D -4.9951e-04 This does not give enough resolution to demonstrate the problem, nor does it visualize temporal dependencies. However, randn() from octave-forge-2004.09.09, does give me a wrong octave> randn("seed", 12345); octave> var(randn(1,1e6)) ans =3D 0.71239 I append printouts of the output of the following sequence of commands: octave> randn("seed", 12345); octave> plot(1:10000, randn(1, 10000), "."); octave> print("-depsc2", "randn-dots.eps"); octave> randn("seed", 12345); octave> hist(randn(1,1e6),-3.75:0.001:3.75); octave> print("-depsc2", "randn-hist.eps"); The second figure suggests that the output of randn() possibly converges to normal over very long sequences of random numbers (albeit with a wrong variance), but notice the ditch at zero that persists even after 6 million samples. The non-normality is revealed by the first figure that demonstrates that the samples are nowhere near Gaussian for sample sizes of at least up to several thousands, due to a strange sequential clustering effect. I also append the counterparts of these figures using the randn() from octave-2.1.57, which do not exhibit these problems (but, incidentally, there are strange tails in the histograms). > before doing your test and seed if it helps. It might also be a build > issue, so can you try with the "-DALLBITS" flag or without it and > see if it makes a difference if 32 or 64 bit ints are used. For info, my rand.cc from octave-forge/FIXES was compiled with -DALLBITS (the default). I don't have the time right now to investigate more deeply, but will later if nobody else can reproduce the problem. Justus APPENDICES - Images as .eps and .eps.gz Buggy results (octave-forge-2004.09.09): http://www.montefiore.ulg.ac.be/~piater/Demos/randn-dots.eps http://www.montefiore.ulg.ac.be/~piater/Demos/randn-dots.eps.gz http://www.montefiore.ulg.ac.be/~piater/Demos/randn-hist.eps http://www.montefiore.ulg.ac.be/~piater/Demos/randn-hist.eps.gz Good results (octave-2.1.57): http://www.montefiore.ulg.ac.be/~piater/Demos/randn-dots-good.eps http://www.montefiore.ulg.ac.be/~piater/Demos/randn-dots-good.eps.gz http://www.montefiore.ulg.ac.be/~piater/Demos/randn-hist-good.eps http://www.montefiore.ulg.ac.be/~piater/Demos/randn-hist-good.eps.gz --=20 Justus H. Piater, Ph.D. http://www.montefiore.ulg.ac.be/~piater/ Institut Montefiore, B28 Phone: +32-4-366-2279 Universit=E9 de Li=E8ge, Belgium Fax: +32-4-366-2620 |