MatLab randn and Simulation Step Numbers
- From: "Matthew Brenneman" <pi2ovr6@xxxxxxxxxxxx>
- Date: 25 Apr 2005 19:47:46 -0700
Hi,
I am testing the MatLab routine randn which is supposed to generate
rv's ~ N(0,1). The test for lack of correaltion looks good, but when I
run a chi-square test to check that the simulated distbtn is the same
as N(0,1) I run into a strange problem: as the number of simulated data
points increases, my chi-square statistics increases.
My simulation is performed so simulated data points are binned in
intervals of 0.01 units (in units of sdev) from -3.5<z<3.5, so I have
N(i) data points in bin i=1,720. I have generated the appropriate
discretized Gaussian pdf, from which I can compute the number of data
points we would expect from a Gaussian distbtn, n(i). Using the
chi-square statistics Sum[ (N(i)-n(i))^2/n(i) ] from i = 1,...,720, I
then have a chi-squre distbtn with 719 degrees of freedom. I find that
as the total number of data points generated increases from 100 to
100,000, the chi-square statistics does not exhibit any type of
montonic behavior and generally increases as the number of data points
generated increases.
Is this a peculiarity with this random number generator? Has anyoe else
experienced this type of problem in the past? Looking at the difference
(N(i)-n(i)) plotted vs i (the bin #), it seems the plot oscillates
significantly, which led me to wonder if I am not binning my data too
closely.
Any suggestions would be greatly appreciated.
TIA,
Matt Brenneman
.
- Follow-Ups:
- Re: MatLab randn and Simulation Step Numbers
- From: Herman Rubin
- Re: MatLab randn and Simulation Step Numbers
- Prev by Date: Re: nonlinear regression
- Next by Date: logistic regression and model misspecification
- Previous by thread: assumption of Classification
- Next by thread: Re: MatLab randn and Simulation Step Numbers
- Index(es):
Relevant Pages
|
|