Re: Puzzled by the "Variance"
- To: mathgroup at smc.vnet.net
- Subject: [mg86513] Re: Puzzled by the "Variance"
- From: David Bailey <dave at Remove_Thisdbailey.co.uk>
- Date: Thu, 13 Mar 2008 04:28:45 -0500 (EST)
- References: <fr8b97$h2s$1@smc.vnet.net>
Elements wrote: > Greeting all > I'm puzzled by the function "Variance". We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. > But mathematica gives that: > > In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. > > Why?? There are two formulae for variance, one where you know the true mean - which you have used - where you divide by N, and another where you can only estimate the mean from the data available, where it is appropriate to divide by (N-1) to obtain an unbiased estimate of the true variance. It is this formula that Mathematica has used. David Bailey http://www.dbaileyconsultancy.co.uk