
Re: Simulation for the standard deviation
Posted:
Feb 26, 2013 9:04 PM


"Cristiano" wrote in message news:kgjnqn$tvp$1@dontemail.me...
On 26/02/2013 1:56, David Jones wrote: > The standard work, Kendall & Stuart's "Theoretical Statistics" will > provide a formula for variance of the sample variance. This could be > used to provide a sampling interval for the sample variance, and hence > for the sample standard deviation. Indeed, a formula for the variance of > the sample variance exists on the Wikipedia page for "Variance". > > In the present context, an alternative is just to do multiple > simulations of the sample standard deviation and use this to get the > sampling distribution empirically. Of course this would assume that the > random number generator has adequate properties.
In my simulations I use the (very good and very fast) dSFMT generator and I get, for example, with n= 2, E[s^2]= .0833584 (good) and Var[s^2]= .00972501.
Using the formula given here: http://en.wikipedia.org/wiki/Variance#Distribution_of_the_sample_variance I get: Var[s^2]= .00369776.
Using the formula given here: http://mathworld.wolfram.com/SampleVarianceDistribution.html I get: Var[s^2]= .000924963.
Where is the error?
Cristiano ============================================================
"Wolfram" is using a definition of sample variance with a divisor "N", the sample size: "Wikipedia" is using the more standard definition of sample variance with a divisor "N1". This explains the ratio of 4 between the 2 answers. You need to check which version you have programmed and which you actually want.
David Jones

