FS2 2.3 - Mean and variance of continuous variables
A density describes the whole distribution; its mean and variance summarise location and spread. You will calculate these summaries by integration, find the expected value of a function of a continuous variable, and use your results to judge how well a model describes observations.
Average values using probability as the weight
If a machine's mean reading is , is its mean squared reading necessarily ? Squaring the average feels natural. Yet a machine with density on has mean squared reading , which is larger. You will find exactly where that extra amount comes from.
You already know
A continuous probability is an area under a density. The density is non-negative, its total area is , and definite integration uses upper minus lower antiderivative values.
Imagine dividing the support into very narrow strips. A strip near has probability approximately . Its contribution to a weighted average is therefore approximately . Adding all such contributions gives an integral.
Expectation and variance
The expectation is the probability-weighted mean of . The variance is the expectation of the squared distance from that mean. For example, positive and negative readings can give mean zero while still having positive variance. Zero mean does not mean zero spread.
The mean is not the average height of the density curve. The curve supplies the weights for averaging the horizontal values.
Mean of a continuous random variable
For a density , when the expectation exists,
Integrate only over the support, splitting the integral if its density has several formulas.
In the formula booklet.
There is no additional division by the support's width: the weights already add to . This differs from the mean value of an ordinary function over an interval. For a variable restricted to , a finite mean lies in , providing a useful check.
Not every continuous model has a finite mean. For example, the valid density on gives , which diverges. Do not force a finite answer from a divergent integral.
Key idea
Expectation averages values using probability weights. For a continuous variable, “value times probability” becomes .
Choose the integral that uses both ingredients.
Find the first two moments before the variance
The second moment is the mean of squared values. It is different from the square of the mean, ; their difference measures spread.
Variance and the second moment
Provided the required moments are finite,
where
The standard deviation is the non-negative square root .
The standard-deviation definition is also supplied.
In the formula booklet.
To see why the shorter variance formula works, expand inside the integral:
The last integral is , not the width of the support.
Worked example 1: a rising linear density
Question. Find the mean and variance of the density on , with density zero elsewhere.
Plan. Calculate and , then subtract the square of the first from the second.
Why square , rather than the integrand? Variance subtracts after the two separate expectations have been found.
Answer. and .
Check. The mean is inside , the variance is positive, and direct expansion gives .
Worked example 2 increases the density's power by one. Its normalising coefficient changes so that the total area remains .
Worked example 2: more weight near the upper endpoint
Question. Find the mean and variance when on , with density zero elsewhere.
Plan. Repeat the same two moment integrals with the new density.
Why does the mean move right? Compared with , this density places more probability near the upper end of the same interval.
Answer. and .
Check. . The new mean exceeds , while the variance is smaller than , consistent with stronger concentration near .
If is a length in centimetres, its mean and standard deviation are in centimetres, while its variance is in square centimetres. A variance quoted as a standard deviation changes both the value and the units.
Watch out
Wrong: . Right: subtract . A negative variance is a signal to check the density, limits and arithmetic.
Increase the density's power once more.
Transform the value before taking its expectation
A payment, area or squared error may be a function of the random measurement. Keep the original density and change the value being averaged. You do not need a new density for the transformed variable.
Expectation of a function
For a continuous random variable with density , provided the expectation exists,
In the formula booklet.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account