MathGroup Archive 2008

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

Search the Archive

Re: Puzzled by the "Variance"

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86590] Re: Puzzled by the "Variance"
  • From: Norbert Marxer <marxer at mec.li>
  • Date: Fri, 14 Mar 2008 04:17:03 -0500 (EST)
  • References: <200803121029.FAA17511@smc.vnet.net> <frclto$rqs$1@smc.vnet.net>

On 14 Mrz., 02:55, "Jaccard Florian" <Florian.Jacc... at he-arc.ch>
wrote:
> You've got a lot of very good answers...
>
> As a complement:
>
> In earlier versions, you could also ask for the biased (or population)
> variance. It still works with v.6, in spice of the fact that it's
> considered as "removed"...
>
> Just write:
>
> data = {1, 2, 3};
> << "Statistics`"
> VarianceMLE[data]
>
> It gives: 2/3
>
> But it's quite dangerous to use "removed" mathematica packages...
>
> I just don't understand why Wolfram removed this function... In most
> other systems, you can ask for both variances!
>
> Florian Jaccard
>
> -----Message d'origine-----
> De: Elements [mailto:phil... at gmail.com]
> Envoy=E9=A0: mercredi, 12. mars 2008 11:29
> =C0=A0: mathgr... at smc.vnet.net
> Objet=A0: =A0Puzzled by the "Variance"
>
> 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??
> --
> Best Wishes!
> Yours Sincerely

Hello

In Mathematica you can use the  built-in function CentralMoment[data,
2].

To summarize this post:

You have (as was posted by many) to distinguish between the two
situations:

1. You do not know the mean and calculate the mean from your data.
Then you divide the sum by "n-1" and use
     Variance[data]
to calculate the variance.

2. You know the mean (for the population).
Then you divide the sum by "n" and use
     CentralMoment[data,2]
or
     Needs["Statistics`"]; VarianceMLE[data]
to calculate the variance.

data = {1, 2, 3};
Variance[data]
Needs["Statistics`"]; VarianceMLE[data]
CentralMoment[data, 2]

I hope this helps.

Best Regards
Norbert Marxer



  • Prev by Date: Re: Re: Should I uninstall the old version before upgrading?
  • Next by Date: Re: V.6.0.2 gripes...
  • Previous by thread: RE: Puzzled by the "Variance"
  • Next by thread: Re: Puzzled by the "Variance"