Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: variance (mg86506)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86609] Re: variance (mg86506)
  • From: Sebastian Meznaric <meznaric at gmail.com>
  • Date: Sat, 15 Mar 2008 03:08:30 -0500 (EST)
  • References: <frasfq$1m4$1@smc.vnet.net>

On Mar 13, 9:34 am, Kowalczyk-Schr=F6der <HB-Kowalczyk-Schroed...@t-
online.de> 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>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??
> --
> Best Wishes!
> Yours Sincerely
>
> Mathematica divides by (N-1) - like as far as I know all programs- This
> is correct if you have only a sample and not the whole. You can look up
> the reason for this and the derivation in some book about statistics.
>
> Sincerely,
>  J. Schroeder
> ############################
> Dr. Joerg Schroeder
> Bremen

Hi. Mathematica calculates the unbiased estimator for the variance
based on your sample. This means it actually calculates
((1-2)^2+(2-2)^2+(3-2)^2)/2. In general, the unbiased estimator is 1/
(N-1) sum((x_i - mean)^2). All you need to do is multiply with (N-1)/N
to obtain your version of the variance. So in your case N=3 so
1*2/3=2/3.


  • Prev by Date: Re: FormatType problems
  • Next by Date: Re: Update 6.0.2
  • Previous by thread: variance (mg86506)
  • Next by thread: Re: Accessing and using built-in constants in Mathematica 6 /