Let's make the experiment more interesting...

--- Oleg Kobchenko <[EMAIL PROTECTED]> wrote:

> --- Raul Miller <[EMAIL PROTECTED]> wrote:
> 
> > On 6/28/07, John Randall <[EMAIL PROTECTED]> wrote:
> > >  X_i has the population distribution, so the variance of X_i is \sigma^2.
> > > The parenthetical (population variance) is an explanatory note, not an
> > > argument for \sigma^2.
> > 
> > Ok, fair enough.
> > 
> > That said, I believe I now understand your proof well enough to assert
> > that your proof works just as well if I use the same calculation
> > for sample standard deviation as I use for population standard
> > deviation.  (With no "n-1" adjustment for the variance when working
> > with samples).
> > 
> > In other words:
> > 
> > Let $\mu$ and $\sigma$ be the population mean and standard deviation.
> > Fix the sample size $n$. Let $\bar X$ be the sample mean, $S^2$ the
> > sample variance given by
> > 
> > $$ S^2=(1/n)\sum (X_i-\bar X)^2$$
> >
> > It is elementary to show $E(\bar X)=\mu$.  We now show
> > $E(S^2)=\sigma^2$.
> 
> This looks like Law of Large Numbers applied--
> however, not for baised estimate of the second 
> central moment above. (See experiment.)
> 
> ...
> > 
> > I've checked my work on this -- I built myself a numerical
> > model representing most of the above statements and
> > have tested both versions of it [yours and mine] against
> > several different populations and sample sizes.
> 
> It would be good to see the model.
> Here's a simple and straightforward Monte Carlo
> experiment running biased and unbiased estimates
> head-to-head.

... by throwing in another estimate of variance
with known population mean and 1/n.

> In fact it show that
> 
>     E((1/n)\sum (X_i-\bar X)^2)    is  (n-1)/n \sigma^2
> and
>     E(1/(n-1)\sum (X_i-\bar X)^2)  is  \sigma^2
      E((1/n)\sum (X_i-\mu)^2)       is  \sigma^2   -- known mean

NB. =========================================================
load 'stats'

samp=: ?@(# #) { ]
bvar=: var * <:@# % #

PS=: 100000

testvar=: 4 : 0
  V=. B=. M=. 0
  D=. normalrand PS
  m=. mean D
  for_i. i.x do.
    d=. y samp D
    V=. V +  var d
    B=. B + bvar d
    M=. M + (+/*: d-m)%y
  end.
  (x%~V,B,M),bvar D
)
NB. =========================================================

   10000 testvar 20                  NB. V,M,D are almost same
0.995711 0.945926 0.995114 0.997888

   0.945926 * 20%19                  NB. compensate bias
0.995712



       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. 
Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to