AoZai
AoZai

Reading Notice

These are personal study and translation notes for reference only; the original course materials belong to MIT OpenCourseWare and their respective rights holders.

ZoomNotes for Linear Algebra

Gilbert Strang, MIT 18.06 · Ch.11 / 11

Part 11: Basic Statistics: Mean, Variance, Covariance

11.1 Mean and Variance: Actual and Expected

Sample Mean:

μˉ=1Ni=1Nxi\bar{\mu} = \frac{1}{N} \sum_{i=1}^N x_i

Expected (Population) Mean:

m=E[x]=ipixim = E[x] = \sum_i p_i x_i

where pip_i are probabilities with pi=1\sum p_i = 1.

Law of Large Numbers: As NN \to \infty, the sample mean converges to the expected mean:

μˉm\bar{\mu} \to m

Sample Variance:

S2=1N1i=1N(xiμˉ)2S^2 = \frac{1}{N-1} \sum_{i=1}^N (x_i - \bar{\mu})^2

The N1N-1 (instead of NN) is Bessel's correction for unbiased estimation.

Population Variance:

σ2=E[(xm)2]=ipi(xim)2=(ipixi2)m2\sigma^2 = E[(x - m)^2] = \sum_i p_i (x_i - m)^2 = (\sum_i p_i x_i^2) - m^2

Standard Deviation: σ=σ2\sigma = \sqrt{\sigma^2} (same units as the data).


11.2 Probability Distributions: Binomial, Poisson, Normal

Binomial Distribution: Bin(n,p)\text{Bin}(n, p) models the number of successes in nn independent trials, each with success probability pp.

P(k successes)=(nk)pk(1p)nk,k=0,1,,nP(k \text{ successes}) = \binom{n}{k} p^k (1-p)^{n-k}, \quad k = 0, 1, \dots, n
  • Mean: μ=np\mu = np
  • Variance: σ2=np(1p)\sigma^2 = np(1-p)

Poisson Distribution: The limit of Binomial as nn \to \infty, p0p \to 0, with npλnp \to \lambda (fixed). Models rare events.

P(k events)=λkeλk!,k=0,1,2,P(k \text{ events}) = \frac{\lambda^k e^{-\lambda}}{k!}, \quad k = 0, 1, 2, \dots
  • Mean: μ=λ\mu = \lambda
  • Variance: σ2=λ\sigma^2 = \lambda (mean equals variance!)

Normal (Gaussian) Distribution: N(m,σ2)\mathcal{N}(m, \sigma^2)

p(x)=12πσ2exp((xm)22σ2)p(x) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x-m)^2}{2\sigma^2}\right)

Standard Normal: N(0,1)\mathcal{N}(0,1) with p(x)=12πex2/2p(x) = \frac{1}{\sqrt{2\pi}} e^{-x^2/2}.

Central Limit Theorem (CLT): The average of NN independent samples from any distribution (with finite mean mm and variance σ2\sigma^2) approaches a normal distribution as NN \to \infty:

xˉmσ/NN(0,1)\frac{\bar{x} - m}{\sigma/\sqrt{N}} \to \mathcal{N}(0,1)

The CLT is why the normal distribution appears everywhere in statistics.


11.3 Covariance Matrices and Joint Probabilities

Covariance measures how two variables vary together:

Cov(X,Y)=E[(XE[X])(YE[Y])]=E[XY]E[X]E[Y]\text{Cov}(X,Y) = E[(X - E[X])(Y - E[Y])] = E[XY] - E[X]E[Y]
  • Positive covariance: XX and YY tend to increase together
  • Negative covariance: one increases as the other decreases
  • Zero covariance: no linear relationship (but doesn't imply independence)

Covariance Matrix VV for a random vector X=(X1,,Xn)TX = (X_1, \dots, X_n)^T:

V=E[(Xm)(Xm)T]V = E[(X - m)(X - m)^T]

where m=E[X]m = E[X]. Entry (i,j)(i,j) is Cov(Xi,Xj)\text{Cov}(X_i, X_j). Diagonal entries are variances Var(Xi)=σi2\text{Var}(X_i) = \sigma_i^2.

Properties of Covariance Matrices:

  • VV is symmetric and positive semidefinite
  • V=V = \sum of rank-1 positive semidefinite matrices
  • VV is positive definite iff the variables are linearly independent
  • For independent variables, VV is diagonal (covariances are zero)

Multivariate Normal Distribution:

p(x)=1(2π)ndetVexp(12(xm)TV1(xm))p(\mathbf{x}) = \frac{1}{\sqrt{(2\pi)^n \det V}} \exp\left(-\frac{1}{2} (\mathbf{x} - \mathbf{m})^T V^{-1} (\mathbf{x} - \mathbf{m})\right)

The contours of constant probability are ellipsoids defined by (xm)TV1(xm)=constant(\mathbf{x} - \mathbf{m})^T V^{-1} (\mathbf{x} - \mathbf{m}) = \text{constant}, with axes aligned with the eigenvectors of VV and axis lengths proportional to λi\sqrt{\lambda_i}.


11.4 Three Basic Inequalities of Statistics

1. Markov's Inequality: For a nonnegative random variable X0X \geq 0 and a>0a > 0:

P(Xa)E[X]aP(X \geq a) \leq \frac{E[X]}{a}

This gives a crude bound on tail probabilities using only the mean.

2. Chebyshev's Inequality: For any random variable XX with mean mm and variance σ2\sigma^2:

P(Xma)σ2a2P(|X - m| \geq a) \leq \frac{\sigma^2}{a^2}

This bounds the probability of being far from the mean using only the variance. It implies that most probability mass lies within a few standard deviations of the mean.

3. Chernoff's Inequality: For a sum S=i=1nXiS = \sum_{i=1}^n X_i of independent random variables:

P(SE[S]t)2exp(t22Var(Xi))P(|S - E[S]| \geq t) \leq 2 \exp\left(-\frac{t^2}{2\sum \text{Var}(X_i)}\right)

This gives exponential tail bounds, which are much sharper than Chebyshev (which only gives 1/a21/a^2 decay). Chernoff bounds are essential for understanding the concentration of measure phenomenon and are the foundation for PAC learning theory.


11.5 Markov Matrices and Markov Chains

A Markov matrix (also called a stochastic matrix) MM satisfies:

  • Mij0M_{ij} \geq 0 (all entries nonnegative)
  • Each column sums to 1 (the probability leaving a state is distributed to other states)

Perron-Frobenius Theorem:

  • The largest eigenvalue is λmax=1\lambda_{\max} = 1
  • All other eigenvalues satisfy λ1|\lambda| \leq 1
  • If all entries are positive (not just nonnegative), then λ<1|\lambda| < 1 for all λ1\lambda \neq 1
  • The eigenvector for λ=1\lambda = 1 has all positive entries (up to scaling)

Markov Chain: A sequence of probability vectors evolving as:

pn+1=Mpn=Mnp0p_{n+1} = M p_n = M^n p_0

Each entry pn(i)p_n(i) is the probability of being in state ii at step nn.

Steady State: The stationary distribution π\pi satisfies:

Mπ=πM \pi = \pi

i.e., π\pi is the eigenvector of MM corresponding to λ=1\lambda = 1, scaled so that its entries sum to 1.

Convergence to Steady State: The distance from pnp_n to π\pi decays at a rate governed by the second eigenvalue λ2\lambda_2:

pnπλ2np0π\|p_n - \pi\| \approx |\lambda_2|^n \|p_0 - \pi\|

The spectral gap 1λ21 - |\lambda_2| determines the mixing time of the Markov chain. A larger gap means faster convergence.

Applications: Markov chains model random processes across physics, chemistry, economics, and computer science -- from Google's PageRank algorithm to Monte Carlo simulations.

Previous Next
© MIT OpenCourseWare  |  18.06 Linear Algebra  |  Gilbert Strang  |  Spring 2010
ocw.mit.edu  ·  CC BY-NC-SA 4.0