MeanAndVariance: Difference between revisions
From charlesreid1
No edit summary |
No edit summary |
||
| Line 6: | Line 6: | ||
(where the integral is over the range of x values) | (where the integral is over the range of x values) | ||
The variance is given by | |||
<math> | <math> | ||
Var(X)^2 = Var(X) = \int (x - \mu)^2 f(x) dx | \sigma^2 = Var(X)^2 = Var(X) = \int (x - \mu)^2 f(x) dx | ||
</math> | </math> | ||
| Line 14: | Line 16: | ||
<math> | <math> | ||
Var(x) = \int (x^2 - 2 x \mu + \mu^2) f(x) dx | |||
</math> | </math> | ||
Revision as of 18:48, 24 May 2017
If we have a continuous random variable $ X $ with a probability density function $ f(x) $, the mean and variance are given by:
$ \mu = E(X) = \int x f(x) dx $
(where the integral is over the range of x values)
The variance is given by
$ \sigma^2 = Var(X)^2 = Var(X) = \int (x - \mu)^2 f(x) dx $
This can be simplified:
$ Var(x) = \int (x^2 - 2 x \mu + \mu^2) f(x) dx $
$ = \int x^2 f(x) d - 2 \mu \int x f(x) dx + \mu^2 \int f(x) dx $
$ = \int x^2 f(x) d - 2 \mu^2 + \mu^2 $
$ = \int x^2 f(x) dx - \mu^2 $
which is equivalent to saying:
$ Var(X) = E(X^2) - E(X)^2 $