MathGroup Archive 2004

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

Search the Archive

Re: Variance

On 11/8/04 at 3:13 AM, johanfo at (JFO) wrote:

>Can anybody help me out with this?  I'm trying to make mathematica
>calculate the variance of an expression, however I don't get the
>result I expected, a numerical value.

>Variance[-0.6 NormalDistribution[0,0.1]]

The reason you are not getting a numerical value is the function Variance doesn't know how to compute the variance of a general expression.

The simplest way to sovle your problem is to realize variance is location independent but not scale independent. That is the variance of m x + b will be m^2 variance(x)

The other useful property of variance is it is additive, i.e., variance(x+y) = variance(x) + variance(y)

So, the solution is:

.1^2(.7^2 + .5^2 + .8^2)

If you were did not know the properties of variance above, you could have Mathematica do the computation using the ExpectedValue function, i.e.,

ExpectedValue[(0.7 #)^2 & , NormalDistribution[0, 0.01]]

Since ExpectedValue[x+y] = ExpectedValue[x]+ExpectedValue[y] it should be clear you could solve you problem as a sum of expected values which will clearly be the same result I showed above.

To reply via email subtract one hundred and four

  • Prev by Date: Re: NonlinearFit problem
  • Next by Date: Re: List element replacement.
  • Previous by thread: Re: Variance
  • Next by thread: finding explicit rule for series