StatlectThe Digital Textbook
Index > Glossary

Variance formula

The variance of a random variable X can be computed using the definition of variance:[eq1]where $QTR{rm}{E}$ denotes the expected value operator.

Formula for discrete variables

When the random variable is discrete the above formula becomes[eq2]where R_X is the set of all possible realizations of X and [eq3] is the probability mass function of X. In other words, we need to compute a weighted average of the squared deviations of X from its mean.

To see how to apply this formula, read some Solved exercises.

Formula for continuous variables

When X is continuous, the formula is[eq4]where [eq5] is the probability density function of X.

To see how to apply this formula, read some Solved exercises.

A simple variance formula

Instead of computing variance using these formulae, it is often easier to use the following equivalent variance formula:[eq6]

For example, when we know the moment generating function of X, we can use it to compute the two moments [eq7] and [eq8] and then plug their values in this formula.

More details

More details about this formula - as well as a proof of it and some solved exercises - can be found in the lecture entitled Variance.

Keep reading the glossary

Previous entry: Unadjusted sample variance

The book

Most learning materials found on this website are now available in a traditional textbook format.