3.6.2 Variance
Variance is a statistical measure that quantifies the extent of dispersion within a distribution of random variables. The variance of a set of observations is defined as the mean of the squares of differences of all the observations from their mean. In simple terms, variance is calculated by four steps:
- Finding the mean of the dataset
- Subtracting this mean from each individual value to get differences
- Squaring these differences
- Finding the mean of the squared results
Mathematically, the variance is represented as:
For population (complete set of observations):
For sample (a subset of observations from population):
Where:
and
represents the variance
represents the
data point in the dataset
represents the mean of the population dataset
is the size of the population consisting of {
,
, ….,
}
represents the mean of the sample dataset
is the size of the sample consisting of {
,
, ….,
}
Why do we divide sample variance by ?
You might be curious why we use instead of
in the denominator of the sample variance formula, unlike the population
variance where we use
.
Let's explore this concept. Imagine we collect independent observations from a population with an average
and variance
, which is a common scenario when dealing with random samples. In cases
involving a population dataset,
and
are usually unknown, and our aim is often to estimate them. The sample
mean
serves as an estimate for the population mean
, while the sample variance
serves as an estimate for the population variance
.
Ideally, we would estimate with:
This represents the average squared distance from the true mean , which is an optimal estimator for
. However, a challenge arises: the population mean
is often unknown, so we cannot use it in this formula. Substituting the
true mean
with our most accurate estimate, the sample mean
, seems logical.
Essentially, our goal is to determine the population variance based on the population mean
. However, we use the sample mean
as an approximation of this population mean
. The sample mean
represents one potential location for the true mean
, while the actual population mean
could be anywhere within the dataset.
If the population mean is at any other position, it means the sum of squares
Σ would be larger than the sum of squares w.r.t sample mean Σ
. Thus, the sample mean we employ to approximate the population mean
effectively minimises this calculation. Consider the scenario depicted in
the diagram above Fig 3.26, where the population mean rests at the right end. The distances between
data points are notably greater in this case. However, irrespective of the
placement of the population…