Statistical Data Analysis and Inference › Statistical Inference: From Samples to Populations

Michael BrenndoerferOctober 22, 20259 min read
Quantitative FinanceAll chapters
Part 1 of 15Mathematical Foundations
Chapter 4Statistical Data Analysis and Inference › Statistical Inference: From Samples to Populations
Reading section 3 of 9 · Statistical Inference: From Samples to Populations · 9 minSection 3 of 9 · 9 min

Book contents

Section 3 of 9 · 9 min read

Statistical Data Analysis and Inference › Statistical Inference: From Samples to PopulationsOne section · Sections in this chapter3 / 9 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Descriptive statistics summarize historical data, but we care about the future. Statistical inference bridges this gap by using sample data to make probabilistic statements about population parameters. This transition from description to inference is perhaps the most important conceptual leap in quantitative analysis.

Sample vs. Population

The distinction between sample and population is fundamental to understanding everything that follows in this section. When we compute a mean return from historical data, we're not calculating the "true" expected return; we're estimating it from limited information.

Population and Sample

The population is the distribution of observations defined by a specified stochastic process, asset, sampling frequency, and regime. Historical analysis often treats observations within a chosen horizon as draws from that population, an assumption that must be examined rather than inferred from an infinite time horizon.

A sample is a subset of observations we collect. Historical returns form our sample, typically covering a limited time period.

We observe sample statistics (denoted with bars or hats: rˉ\bar{r}, σ^\hat{\sigma}) and use them to estimate population parameters (denoted with Greek letters: μ\mu, σ\sigma). This notational convention is a constant reminder that what we calculate from data (sample statistics) and what we're trying to learn about (population parameters) are different quantities.

The key challenge: sample statistics vary from sample to sample. Under a common population model, different samples can produce different mean estimates because of sampling error. Means from 2010-2020 and 2015-2025 may also differ because the population mean or regime changed; they need not differ. With independent underlying observations of a common finite, positive variance, their shared observations give the two mean estimates positive covariance. Sampling variation is an inherent feature of estimation, not a calculation mistake. Distinguishing it from changes in the generating process matters when interpreting historical windows.

The Standard Error

The standard error quantifies how much a sample statistic varies across different samples. It answers: if I collected a new sample of the same size, how different might my estimate be? For independent observations with a common finite, positive variance σ2\sigma^2, the sample-mean variance is σ2/n\sigma^2/n, so:

SE(rˉ)=σnSE(\bar{r}) = \frac{\sigma}{\sqrt{n}}

where:

  • SE(rˉ)SE(\bar{r}): standard error of the sample mean, measuring how much rˉ\bar{r} would vary across repeated samples
  • σ\sigma: population standard deviation (true variability of individual returns)
  • nn: sample size (number of observations)
  • The n\sqrt{n} in the denominator reflects that averaging reduces variability, but with diminishing returns. At fixed positive population volatility, halving the standard error requires four times as much data

This formula captures one of the most important relationships in statistics under that sampling model. In general,

Var⁡(rˉ)=1n2∑i=1n∑j=1nCov⁡(ri,rj),\operatorname{Var}(\bar r)=\frac{1}{n^2}\sum_{i=1}^{n}\sum_{j=1}^{n}\operatorname{Cov}(r_i,r_j),

Here Var⁡\operatorname{Var} measures variability and Cov⁡\operatorname{Cov} measures how two observations vary together. The double sum includes nn individual variances and all ordered off-diagonal covariance terms. Independence makes the off-diagonal terms zero; a common variance then leaves nσ2/n2=σ2/nn\sigma^2/n^2=\sigma^2/n. Dependence can increase or decrease mean uncertainty, depending on the covariance terms.

When the independence and positive common-variance conditions apply, more variable data produces less precise estimates and larger samples produce more precise estimates. The square root relationship means precision improves slowly with additional data.

In practice, we estimate σ\sigma with the sample standard deviation ss:

SE^(rˉ)=sn\widehat{SE}(\bar{r}) = \frac{s}{\sqrt{n}}

For i.i.d. normal observations, replacing σ\sigma with ss leads to exact Student-t inference for the mean. For nonnormal i.i.d. observations, a t-based procedure may be a useful large-sample approximation under suitable regularity conditions. Large nn alone does not repair an invalid independence assumption or guarantee a good approximation for very heavy-tailed data.

In[18]:
Code
n = len(log_returns)
standard_error = std_daily / np.sqrt(n)
Out[19]:
Console
Sample size: 251
Sample mean: 0.000199
Standard error of mean: 0.001219
Ratio (SE/mean): 6.14
Out[20]:
Visualization
Line chart showing standard error percentage decreasing as sample size increases, with annotated points at common sample sizes such as 50, 252, 504, and 1000.
Under the independent model shown here, with fixed positive population volatility, standard error of the mean decreases with the square root of sample size. Halving the standard error requires four times as much data.

Under the independent common-variance model with fixed positive population volatility, the standard error decreases with the square root of the sample size. To halve that standard error, you need four times as much data. In finance, this slow improvement can leave mean return estimates imprecise even with long samples. In this seeded example, the printed ratio shows that the standard error is large relative to the sample mean, so the mean estimate is noisy.

The Central Limit Theorem

The Central Limit Theorem (CLT) is one of the most important results in statistics, and its implications extend beyond textbooks. It provides the theoretical justification for using normal distribution-based methods even when the data themselves are not normally distributed.

Central Limit Theorem

If r1,r2,…r_1, r_2, \ldots are independent and identically distributed random variables with finite mean μ\mu and finite, positive variance σ2\sigma^2, then as n→∞n \to \infty:

rˉ−μσ/n→dN(0,1)\frac{\bar{r} - \mu}{\sigma/\sqrt{n}} \overset{d}{\to} N(0, 1)

where:

  • rˉ\bar{r}: sample mean
  • μ\mu: population mean
  • σ/n\sigma/\sqrt{n}: standard error of the mean
  • →d\overset{d}{\to}: convergence in distribution (meaning the distribution of the left side approaches the distribution on the right as nn grows)
  • N(0,1)N(0, 1): standard normal distribution (mean 0, variance 1)

The left side of the equation is called the standardized sample mean or z-score of the sample mean. Under the stated i.i.d. and finite-variance conditions, the CLT tells us this standardized value becomes approximately normal as nn grows.

The sample mean rˉ\bar{r} is approximately normally distributed with mean μ\mu and standard deviation σ/n\sigma/\sqrt{n}.

This theorem is powerful. Under its i.i.d. and finite-variance conditions, it tells us that the standardized sample mean converges to a normal distribution regardless of the population's shape. A distribution can be skewed, bimodal, or heavy-tailed and still satisfy the theorem, but infinite variance or material dependence requires different conditions and may produce a different limit.

Averaging and the CLT describe two related but distinct effects. Averaging reduces the variance of the unscaled sample mean, which concentrates it around μ\mu. Under the stated conditions, repeated convolution together with centering by μ\mu and scaling by σ/n\sigma/\sqrt{n} produces the normal limiting shape. Concentration by itself does not imply a bell curve.

Even if individual observations are not normally distributed, averages may be approximately normal when the sampling conditions and sample size make the CLT approximation adequate. Financial dependence, changing volatility, and very heavy tails can slow or invalidate that approximation, so normal-based inference for returns needs diagnostics or robust alternatives.

Let's demonstrate the CLT by repeatedly sampling and computing means:

In[21]:
Code
# Generate a non-normal distribution (mixture of normals)
np.random.seed(123)
population = np.concatenate(
    [
        np.random.normal(-0.02, 0.01, 5000),  # Crash regime
        np.random.normal(0.001, 0.015, 45000),  # Normal regime
    ]
)

# Sample means for different sample sizes
sample_sizes = [5, 30, 100, 500]
n_simulations = 1000

sample_means = {}
for size in sample_sizes:
    means = [
        np.mean(np.random.choice(population, size=size, replace=True))
        for _ in range(n_simulations)
    ]
    sample_means[size] = means
Out[22]:
Visualization
Histogram of sample means for samples of five observations with an overlaid theoretical normal curve.
Sample means for n = 5 are already roughly bell-shaped in this example, with visible finite-simulation histogram fluctuations.
Histogram of sample means for samples of thirty observations with an overlaid theoretical normal curve.
In this seeded simulation, sample means for n = 30 form a visibly bell-shaped distribution.
Out[23]:
Visualization
Histogram of sample means for samples of one hundred observations with an overlaid theoretical normal curve.
In this seeded simulation, sample means for n = 100 visually track the theoretical normal curve.
Histogram of sample means for samples of five hundred observations with an overlaid theoretical normal curve.
In this seeded simulation, sample means for n = 500 are visually close to the theoretical normal approximation.

In this seeded simulation, sample means are already roughly bell-shaped at n=5n=5, despite the nonnormal mixture used as the population. Their spread decreases as sample size grows, and the n=500n=500 histogram is visually close to the normal overlay. Finite-simulation histogram fluctuations appear at all four sizes; they do not, by themselves, measure departures from normality. These sample sizes describe this example, not universal CLT thresholds.