1. Home
  2. Explore
  3. Statistics
  4. Regression Analysis

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Regression Analysis

Regression Analysis

Setting Up the Multiple Linear Regression Problem

Regression analysis is one of the most powerful methods in statistical modeling. Its foundations are critical for any statistical modeling exercise, especially in finance and other applied disciplines.

We begin with a dataset consisting of n cases indexed by iii. For each case, there is a single dependent variable (or response variable) yiy_iyi​ — the variable of focus. Together with that, there are explanatory variables (or independent variables) xi,1,xi,2,…,xi,px_{i,1}, x_{i,2}, \ldots, x_{i,p}xi,1​,xi,2​,…,xi,p​.

  • Example: yiy_iyi​ could be stock returns; explanatory variables could be underlying stock characteristics.

  • Example: yiy_iyi​ could be the change in an index (e.g., S&P 500); explanatory variables could be macroeconomic factors.

The goal of regression analysis is to extract or exploit the relationship between the dependent and independent variables. Common applications include:

  • Prediction (most common in finance)

  • Causal inference – testing hypotheses about which factors truly drive the dependent variable

  • Approximation – smooth, differentiable functions can be approximated well by Taylor series expansions

  • Uncovering and validating functional relationships among variables

The General Linear Model

The discussion proceeds in stages:

  1. Ordinary Least Squares (OLS) – a purely mathematical criterion for specifying regression models

  2. Gauss-Markov Theorem – introduces weak statistical modeling principles

  3. Normal Linear Regression Models – formal models with distributional assumptions

  4. Extensions – generalized estimators, robust methods, etc.

Mathematical Formulation

The linear model attempts to model the conditional distribution of the response variable yiy_iyi​ given the independent variables xix_ixi​. It is written as:

yi=β1xi,1+β2xi,2+⋯+βpxi,p+ϵiy_i = \beta_1 x_{i,1} + \beta_2 x_{i,2} + \cdots + \beta_p x_{i,p} + \epsilon_iyi​=β1​xi,1​+β2​xi,2​+⋯+βp​xi,p​+ϵi​

The β\betaβ's are the regression parameters defining the linear relationship. The ϵi\epsilon_iϵi​ are residuals (error terms) that represent uncertainty due to measurement error, modeling error, or underlying stochastic processes.

How Broad Are Linear Models?

Despite the name "linear," these models are extremely flexible:

  • Polynomial approximation – corresponds to a truncated Taylor series

  • Fourier series – a set of basis functions that can approximate most bounded functions, especially those with cyclical structure

  • Time series regressions – cases iii index time points; independent variables can include lags of the response variable (autoregressive models), widely used in finance

Steps for Fitting a Regression Model

  1. Propose a model: Identify the response variable and its scale (e.g., modeling log prices rather than absolute prices, because percentage changes are often more predictable). Also choose which independent variables to include. Note that independent variables can be functions, lagged values, or other transformations, so linear modeling can capture much nonlinear behavior.

  2. Specify assumptions about the distribution of the residuals ϵi\epsilon_iϵi​: This includes assumptions about their means, variances, and correlations.

  3. Define a criterion for judging different estimators of the regression parameters. Several criteria will be examined:

    • Least squares (first)

    • Maximum likelihood

    • Robust methods (contamination-resistant)

    • Bayes methods (for incorporating subjective beliefs)

    • Methods for incomplete/missing data

  4. Characterize the best estimator and apply it to the data.

  5. Check assumptions: Analyze residuals to see if assumptions hold (constant variance, no correlation, etc.). Use influence diagnostics to identify cases that drive the estimates. Detect outliers.

  6. If necessary, modify the model and/or assumptions and repeat.

The philosophy is to tailor the model to the process being modeled, not to force a simple linear regression onto every problem.

Key takeaway: Checking assumptions is critical. Often this step reveals features that lead to expanding or changing the assumptions.

Assumptions for the Residual Distribution

Several levels of assumptions can be made:

  • Gauss-Markov assumptions (weak):

    • Zero mean: E[ϵi]=0E[\epsilon_i] = 0E[ϵi​]=0 (no systematic bias)

    • Constant variance: Var(ϵi)=σ2\text{Var}(\epsilon_i) = \sigma^2Var(ϵi​)=σ2 (homoscedasticity)

    • Uncorrelated errors: Cov(ϵi,ϵj)=0\text{Cov}(\epsilon_i, \epsilon_j) = 0Cov(ϵi​,ϵj​)=0 for i≠ji \neq ji=j

    These are weaker than full independence.

  • Normal linear regression model: Residuals are assumed to be independent and identically distributed (IID) as Gaussian with mean 0 and variance σ2\sigma^2σ2: ϵi∼N(0,σ2)\epsilon_i \sim N(0, \sigma^2)ϵi​∼N(0,σ2).

  • Generalized Gauss-Markov assumptions: Zero mean still holds, but the covariance matrix of the residuals is not necessarily diagonal or scalar. This allows for unequal variances and correlations among residuals.

Why Residuals Might Be Correlated

  • Nonlinearity: Fitting a straight line to a nonlinear curve creates residuals that are consistently above or below the line in different regions.

  • Time dependence: Underlying factors that persist over time can cause the linear relationship to systematically over- or underestimate the dependent variable.

Matrix Representation for Covariances

For an nnn-vector of random variables Y=(Y1,…,Yn)T\mathbf{Y} = (Y_1, \ldots, Y_n)^TY=(Y1​,…,Yn​)T, the expectation is E[\mathbf{Y}] = (\mu_1, \ldots, \mu_n)^T\). The **covariance matrix** is ann \times nmatrixwithmatrix withmatrixwithithdiagonalentryth diagonal entrythdiagonalentry\text{Var}(Y_i)andandand(i,j)entryentryentry\text{Cov}(Y_i, Y_j)$. Matrix notation is essential in regression.

Ordinary Least Squares (OLS)

The Least Squares Criterion

Given a regression parameter vector β=(β1,…,βp)T\boldsymbol{\beta} = (\beta_1, \ldots, \beta_p)^Tβ=(β1​,…,βp​)T, the least squares criterion is:

Q(β)=∑i=1n(yi−y^i)2=∑i=1n(yi−xiTβ)2Q(\boldsymbol{\beta}) = \sum_{i=1}^n (y_i - \hat{y}_i)^2 = \sum_{i=1}^n (y_i - \mathbf{x}_i^T \boldsymbol{\beta})^2Q(β)=∑i=1n​(yi​−y^​i​)2=∑i=1n​(yi​−xiT​β)2

where y^i=xiTβ\hat{y}_i = \mathbf{x}_i^T \boldsymbol{\beta}y^​i​=xiT​β is the linear prediction.

The ordinary least squares (OLS) estimate β^\hat{\boldsymbol{\beta}}β^​ minimizes Q(β)Q(\boldsymbol{\beta})Q(β).

Matrix Formulation

Let y\mathbf{y}y be the nnn-vector of response variables, and let X\mathbf{X}X be the n×pn \times pn×p matrix of independent variables (rows = cases, columns = variables). Then:

y^=Xβ\hat{\mathbf{y}} = \mathbf{X} \boldsymbol{\beta}y^​=Xβ
Q(β)=(y−Xβ)T(y−Xβ)Q(\boldsymbol{\beta}) = (\mathbf{y} - \mathbf{X}\boldsymbol{\beta})^T (\mathbf{y} - \mathbf{X}\boldsymbol{\beta})Q(β)=(y−Xβ)T(y−Xβ)

Taking the derivative with respect to β\boldsymbol{\beta}β (a vector) and setting to zero gives the normal equations:

XT(y−Xβ)=0\mathbf{X}^T (\mathbf{y} - \mathbf{X}\boldsymbol{\beta}) = \mathbf{0}XT(y−Xβ)=0

If XTX\mathbf{X}^T \mathbf{X}XTX is invertible, the OLS estimate is:

β^=(XTX)−1XTy\hat{\boldsymbol{\beta}} = (\mathbf{X}^T \mathbf{X})^{-1} \mathbf{X}^T \mathbf{y}β^​=(XTX)−1XTy

When is XTX\mathbf{X}^T \mathbf{X}XTX Invertible?

X\mathbf{X}X must have full column rank (rank ppp). This means no column of X\mathbf{X}X can be expressed as a linear combination of the others. If rank is less than ppp, the OLS estimate may be non-unique, but predictions can still be made.

Fitted Values and the Hat Matrix

The fitted values are:

y^=Xβ^=X(XTX)−1XTy=Hy\hat{\mathbf{y}} = \mathbf{X} \hat{\boldsymbol{\beta}} = \mathbf{X} (\mathbf{X}^T \mathbf{X})^{-1} \mathbf{X}^T \mathbf{y} = \mathbf{H} \mathbf{y}y^​=Xβ^​=X(XTX)−1XTy=Hy

The hat matrix H=X(XTX)−1XT\mathbf{H} = \mathbf{X} (\mathbf{X}^T \mathbf{X})^{-1} \mathbf{X}^TH=X(XTX)−1XT is an orthogonal projection matrix that projects y\mathbf{y}y onto the column space of X\mathbf{X}X.

Residuals are:

ϵ^=y−y^=(In−H)y\hat{\boldsymbol{\epsilon}} = \mathbf{y} - \hat{\mathbf{y}} = (\mathbf{I}_n - \mathbf{H}) \mathbf{y}ϵ^=y−y^​=(In​−H)y

The matrix In−H\mathbf{I}_n - \mathbf{H}In​−H projects y\mathbf{y}y onto the space orthogonal to the column space of X\mathbf{X}X. The normal equations imply that XTϵ^=0\mathbf{X}^T \hat{\boldsymbol{\epsilon}} = \mathbf{0}XTϵ^=0, i.e., the residual vector is orthogonal to every column of X\mathbf{X}X.

The Gauss-Markov Theorem

Now introduce probability: the observed y\mathbf{y}y is a realization of a random vector Y=(Y1,…,Yn)T\mathbf{Y} = (Y_1, \ldots, Y_n)^TY=(Y1​,…,Yn​)T.

Gauss-Markov assumptions (conditional on X\mathbf{X}X and β\boldsymbol{\beta}β):

  • E[Y∣X,β]=XβE[\mathbf{Y} | \mathbf{X}, \boldsymbol{\beta}] = \mathbf{X} \boldsymbol{\beta}E[Y∣X,β]=Xβ

  • Cov[Y∣X,β]=σ2In\text{Cov}[\mathbf{Y} | \mathbf{X}, \boldsymbol{\beta}] = \sigma^2 \mathbf{I}_nCov[Y∣X,β]=σ2In​ (constant variance and uncorrelated errors)

Consider estimating a linear combination of the regression parameters:

θ=aTβ\theta = \mathbf{a}^T \boldsymbol{\beta}θ=aTβ

where a\mathbf{a}a is a known ppp-vector. This is general enough to cover predictions (e.g., the expectation of yyy for a new x\mathbf{x}x).

The OLS estimator θ^=aTβ^\hat{\theta} = \mathbf{a}^T \hat{\boldsymbol{\beta}}θ^=aTβ^​ is:

  • Unbiased: E[θ^]=θE[\hat{\theta}] = \thetaE[θ^]=θ

  • Linear: θ^\hat{\theta}θ^ is a linear combination of the yiy_iyi​'s (since β^\hat{\boldsymbol{\beta}}β^​ is linear in y\mathbf{y}y)

The Gauss-Markov Theorem: Under the Gauss-Markov assumptions, θ^=aTβ^\hat{\theta} = \mathbf{a}^T \hat{\boldsymbol{\beta}}θ^=aTβ^​ has the smallest variance among all linear unbiased estimators of θ\thetaθ. It is the BLUE (Best Linear Unbiased Estimator).

Proof Sketch

Consider any other linear unbiased estimator θ~=cTy\tilde{\theta} = \mathbf{c}^T \mathbf{y}θ~=cTy. Write c=d+f\mathbf{c} = \mathbf{d} + \mathbf{f}c=d+f, where d\mathbf{d}d is in the column space of X\mathbf{X}X (so dTy\mathbf{d}^T \mathbf{y}dTy corresponds to OLS part) and f\mathbf{f}f is orthogonal to that space. Unbiasedness forces f\mathbf{f}f to be orthogonal to X\mathbf{X}X as well. Then:

Var(θ~)=Var(dTy)+Var(fTy)+2Cov(dTy,fTy)\text{Var}(\tilde{\theta}) = \text{Var}(\mathbf{d}^T \mathbf{y}) + \text{Var}(\mathbf{f}^T \mathbf{y}) + 2\text{Cov}(\mathbf{d}^T \mathbf{y}, \mathbf{f}^T \mathbf{y})Var(θ~)=Var(dTy)+Var(fTy)+2Cov(dTy,fTy)

The covariance term is zero because f\mathbf{f}f is orthogonal to the column space and Cov(Y)=σ2I\text{Cov}(\mathbf{Y}) = \sigma^2 \mathbf{I}Cov(Y)=σ2I. Hence Var(θ~)=Var(θ^)+σ2∥f∥2≥Var(θ^)\text{Var}(\tilde{\theta}) = \text{Var}(\hat{\theta}) + \sigma^2 \|\mathbf{f}\|^2 \ge \text{Var}(\hat{\theta})Var(θ~)=Var(θ^)+σ2∥f∥2≥Var(θ^), with equality only if f=0\mathbf{f}=0f=0.

Generalized Least Squares (GLS)

Generalized Gauss-Markov assumptions: residuals still have zero mean, but the covariance matrix is Cov(ϵ)=σ2Σ\text{Cov}(\boldsymbol{\epsilon}) = \sigma^2 \boldsymbol{\Sigma}Cov(ϵ)=σ2Σ, where Σ\boldsymbol{\Sigma}Σ is a known n×nn \times nn×n positive definite matrix (allowing unequal variances and correlations). The model is:

Y=Xβ+ϵ,E[ϵ]=0,Cov(ϵ)=σ2Σ\mathbf{Y} = \mathbf{X} \boldsymbol{\beta} + \boldsymbol{\epsilon}, \quad E[\boldsymbol{\epsilon}] = \mathbf{0}, \quad \text{Cov}(\boldsymbol{\epsilon}) = \sigma^2 \boldsymbol{\Sigma}Y=Xβ+ϵ,E[ϵ]=0,Cov(ϵ)=σ2Σ

Transformation to Standard Form

Since Σ\boldsymbol{\Sigma}Σ is positive definite, we can write Σ=Σ1/2(Σ1/2)T\boldsymbol{\Sigma} = \boldsymbol{\Sigma}^{1/2} (\boldsymbol{\Sigma}^{1/2})^TΣ=Σ1/2(Σ1/2)T. Define:

  • Y∗=Σ−1/2Y\mathbf{Y}^* = \boldsymbol{\Sigma}^{-1/2} \mathbf{Y}Y∗=Σ−1/2Y

  • X∗=Σ−1/2X\mathbf{X}^* = \boldsymbol{\Sigma}^{-1/2} \mathbf{X}X∗=Σ−1/2X

  • ϵ∗=Σ−1/2ϵ\boldsymbol{\epsilon}^* = \boldsymbol{\Sigma}^{-1/2} \boldsymbol{\epsilon}ϵ∗=Σ−1/2ϵ

Then E[ϵ∗]=0E[\boldsymbol{\epsilon}^*] = \mathbf{0}E[ϵ∗]=0 and Cov(ϵ∗)=σ2In\text{Cov}(\boldsymbol{\epsilon}^*) = \sigma^2 \mathbf{I}_nCov(ϵ∗)=σ2In​, so the transformed model satisfies the original Gauss-Markov assumptions.

The GLS estimator is obtained by applying OLS to the transformed data:

β^GLS=(X∗TX∗)−1X∗TY∗=(XTΣ−1X)−1XTΣ−1Y\hat{\boldsymbol{\beta}}_{GLS} = (\mathbf{X}^{*T} \mathbf{X}^*)^{-1} \mathbf{X}^{*T} \mathbf{Y}^* = (\mathbf{X}^T \boldsymbol{\Sigma}^{-1} \mathbf{X})^{-1} \mathbf{X}^T \boldsymbol{\Sigma}^{-1} \mathbf{Y}β^​GLS​=(X∗TX∗)−1X∗TY∗=(XTΣ−1X)−1XTΣ−1Y

Observations with larger variances are down-weighted by the Σ−1\boldsymbol{\Sigma}^{-1}Σ−1 factor.

Distribution Theory for Normal Linear Regression Models

Assume now that the residuals are independently and identically distributed as normal: ϵi∼N(0,σ2)\epsilon_i \sim N(0, \sigma^2)ϵi​∼N(0,σ2). Then, conditioning on X\mathbf{X}X and β\boldsymbol{\beta}β:

Y∼Nn(Xβ,σ2In)\mathbf{Y} \sim N_n(\mathbf{X}\boldsymbol{\beta}, \sigma^2 \mathbf{I}_n)Y∼Nn​(Xβ,σ2In​)

where NnN_nNn​ denotes an nnn-variate normal distribution with mean vector Xβ\mathbf{X}\boldsymbol{\beta}Xβ and covariance matrix σ2In\sigma^2 \mathbf{I}_nσ2In​.

Moment Generating Function for Multivariate Normal

For an nnn-variate random vector Y\mathbf{Y}Y with mean μ\boldsymbol{\mu}μ and covariance Σ\boldsymbol{\Sigma}Σ, the moment generating function (MGF) is:

MY(t)=E[etTY]=etTμ+12tTΣtM_{\mathbf{Y}}(\mathbf{t}) = E[e^{\mathbf{t}^T \mathbf{Y}}] = e^{\mathbf{t}^T \boldsymbol{\mu} + \frac{1}{2} \mathbf{t}^T \boldsymbol{\Sigma} \mathbf{t}}MY​(t)=E[etTY]=etTμ+21​tTΣt

For the normal regression model, μ=Xβ\boldsymbol{\mu} = \mathbf{X}\boldsymbol{\beta}μ=Xβ and Σ=σ2I\boldsymbol{\Sigma} = \sigma^2 \mathbf{I}Σ=σ2I.

Distribution of OLS Estimator

The OLS estimator is β^=(XTX)−1XTY\hat{\boldsymbol{\beta}} = (\mathbf{X}^T \mathbf{X})^{-1} \mathbf{X}^T \mathbf{Y}β^​=(XTX)−1XTY. This is a linear transformation of Y\mathbf{Y}Y. Using the MGF approach, we can derive its distribution. For any vector τ∈Rp\boldsymbol{\tau} \in \mathbb{R}^pτ∈Rp, the MGF of β^\hat{\boldsymbol{\beta}}β^​ is:

Mβ^(τ)=E[eτTβ^]=exp⁡(τTβ+12τT(σ2(XTX)−1)τ)M_{\hat{\boldsymbol{\beta}}}(\boldsymbol{\tau}) = E[e^{\boldsymbol{\tau}^T \hat{\boldsymbol{\beta}}}] = \exp\left( \boldsymbol{\tau}^T \boldsymbol{\beta} + \frac{1}{2} \boldsymbol{\tau}^T (\sigma^2 (\mathbf{X}^T \mathbf{X})^{-1}) \boldsymbol{\tau} \right)Mβ^​​(τ)=E[eτTβ^​]=exp(τTβ+21​τT(σ2(XTX)−1)τ)

This is the MGF of a multivariate normal distribution. Hence:

β^∼Np(β,σ2(XTX)−1)\hat{\boldsymbol{\beta}} \sim N_p\left( \boldsymbol{\beta}, \sigma^2 (\mathbf{X}^T \mathbf{X})^{-1} \right)β^​∼Np​(β,σ2(XTX)−1)

In particular, the marginal distribution of each β^j\hat{\beta}_jβ^​j​ is:

β^j∼N(βj,σ2[(XTX)−1]jj)\hat{\beta}_j \sim N\left( \beta_j, \sigma^2 [(\mathbf{X}^T \mathbf{X})^{-1}]_{jj} \right)β^​j​∼N(βj​,σ2[(XTX)−1]jj​)

To see this, set τ\boldsymbol{\tau}τ to have a single non-zero component (the jjjth), and the resulting MGF is univariate normal.

QR Decomposition

Any n×pn \times pn×p matrix X\mathbf{X}X (with n≥pn \ge pn≥p) can be decomposed as:

X=QR\mathbf{X} = \mathbf{Q} \mathbf{R}X=QR

where Q\mathbf{Q}Q is an n×pn \times pn×p matrix with orthonormal columns (QTQ=Ip\mathbf{Q}^T \mathbf{Q} = \mathbf{I}_pQTQ=Ip​) and R\mathbf{R}R is a p×pp \times pp×p upper triangular matrix.

The decomposition can be obtained by Gram-Schmidt orthonormalization:

  • First column: r11=∥X1∥r_{11} = \| \mathbf{X}_1 \|r11​=∥X1​∥, Q1=X1/r11\mathbf{Q}_1 = \mathbf{X}_1 / r_{11}Q1​=X1​/r11​

  • Subsequent columns: for j>1j>1j>1, r1j=Q1TXjr_{1j} = \mathbf{Q}_1^T \mathbf{X}_jr1j​=Q1T​Xj​, then orthogonalize Xj\mathbf{X}_jXj​ against Q1\mathbf{Q}_1Q1​; continue.

With the QR decomposition:

  • The OLS estimate simplifies: β^=R−1QTy\hat{\boldsymbol{\beta}} = \mathbf{R}^{-1} \mathbf{Q}^T \mathbf{y}β^​=R−1QTy

  • The hat matrix: H=QQT\mathbf{H} = \mathbf{Q} \mathbf{Q}^TH=QQT

  • The covariance matrix: Cov(β^)=σ2(XTX)−1=σ2R−1(R−1)T\text{Cov}(\hat{\boldsymbol{\beta}}) = \sigma^2 (\mathbf{X}^T \mathbf{X})^{-1} = \sigma^2 \mathbf{R}^{-1} (\mathbf{R}^{-1})^TCov(β^​)=σ2(XTX)−1=σ2R−1(R−1)T

These forms are numerically stable and computationally convenient.

Fundamental Results for Normal Linear Models

A General Theorem on Linear Transformations

If Y∼Nn(μ,σ2I)\mathbf{Y} \sim N_n(\boldsymbol{\mu}, \sigma^2 \mathbf{I})Y∼Nn​(μ,σ2I), then for any matrix Am×n\mathbf{A}_{m \times n}Am×n​, the transformed vector Z=AY\mathbf{Z} = \mathbf{A} \mathbf{Y}Z=AY is also normal:

Z∼Nm(Aμ,σ2AAT)\mathbf{Z} \sim N_m(\mathbf{A} \boldsymbol{\mu}, \sigma^2 \mathbf{A} \mathbf{A}^T)Z∼Nm​(Aμ,σ2AAT)

This is a direct consequence of the MGF.

Independence of β^\hat{\boldsymbol{\beta}}β^​ and Residuals

In the normal linear regression model, β^\hat{\boldsymbol{\beta}}β^​ and ϵ^\hat{\boldsymbol{\epsilon}}ϵ^ are independent random variables. This follows because β^\hat{\boldsymbol{\beta}}β^​ is a linear function of Y\mathbf{Y}Y and ϵ^=(I−H)Y\hat{\boldsymbol{\epsilon}} = (\mathbf{I} - \mathbf{H})\mathbf{Y}ϵ^=(I−H)Y. Their covariance is zero:

Cov(β^,ϵ^)=σ2(XTX)−1XT(I−H)=0\text{Cov}(\hat{\boldsymbol{\beta}}, \hat{\boldsymbol{\epsilon}}) = \sigma^2 (\mathbf{X}^T \mathbf{X})^{-1} \mathbf{X}^T (\mathbf{I} - \mathbf{H}) = \mathbf{0}Cov(β^​,ϵ^)=σ2(XTX)−1XT(I−H)=0

Since they are jointly normal, zero covariance implies independence.

Distribution of Residual Sum of Squares

Define the residual sum of squares SSE=ϵ^Tϵ^=∑i(yi−y^i)2SSE = \hat{\boldsymbol{\epsilon}}^T \hat{\boldsymbol{\epsilon}} = \sum_i (y_i - \hat{y}_i)^2SSE=ϵ^Tϵ^=∑i​(yi​−y^​i​)2. Then:

SSEσ2∼χn−p2\frac{SSE}{\sigma^2} \sim \chi^2_{n-p}σ2SSE​∼χn−p2​

where χn−p2\chi^2_{n-p}χn−p2​ is a chi-squared random variable with n−pn-pn−p degrees of freedom. (A χk2\chi^2_kχk2​ is the sum of kkk independent squared standard normal variables.)

t-Distributions for Coefficients

For each coefficient jjj, we have:

β^j∼N(βj,σ2cjj)\hat{\beta}_j \sim N\left( \beta_j, \sigma^2 c_{jj} \right)β^​j​∼N(βj​,σ2cjj​)

where cjj=[(XTX)−1]jjc_{jj} = [(\mathbf{X}^T \mathbf{X})^{-1}]_{jj}cjj​=[(XTX)−1]jj​. If we estimate σ2\sigma^2σ2 by s2=SSE/(n−p)s^2 = SSE/(n-p)s2=SSE/(n−p), then:

β^j−βjscjj∼tn−p\frac{\hat{\beta}_j - \beta_j}{s \sqrt{c_{jj}}} \sim t_{n-p}scjj​​β^​j​−βj​​∼tn−p​

a Student's t distribution with n−pn-pn−p degrees of freedom. This is used for hypothesis testing and confidence intervals.

Maximum Likelihood Estimation

Maximum likelihood (ML) estimation is a general principle: choose parameter values that maximize the likelihood function (the joint density of the data given the parameters).

For the normal linear regression model, the likelihood function is:

L(β,σ2)=∏i=1n12πσ2exp⁡(−(yi−xiTβ)22σ2)L(\boldsymbol{\beta}, \sigma^2) = \prod_{i=1}^n \frac{1}{\sqrt{2\pi \sigma^2}} \exp\left( -\frac{(y_i - \mathbf{x}_i^T \boldsymbol{\beta})^2}{2\sigma^2} \right)L(β,σ2)=∏i=1n​2πσ2​1​exp(−2σ2(yi​−xiT​β)2​)

Maximizing LLL is equivalent to minimizing the negative log-likelihood:

−log⁡L=n2log⁡(2πσ2)+12σ2∑i=1n(yi−xiTβ)2-\log L = \frac{n}{2} \log(2\pi \sigma^2) + \frac{1}{2\sigma^2} \sum_{i=1}^n (y_i - \mathbf{x}_i^T \boldsymbol{\beta})^2−logL=2n​log(2πσ2)+2σ21​∑i=1n​(yi​−xiT​β)2

For a fixed σ2\sigma^2σ2, minimizing this is equivalent to minimizing the sum of squares. Therefore, the OLS estimator β^\hat{\boldsymbol{\beta}}β^​ is also the maximum likelihood estimator under normality.

The ML estimate of σ2\sigma^2σ2 is σ^2=SSE/n\hat{\sigma}^2 = SSE/nσ^2=SSE/n, which differs slightly from the unbiased estimator s2=SSE/(n−p)s^2 = SSE/(n-p)s2=SSE/(n−p).

Key point: When fitting models by least squares, the procedure is consistent with the maximum likelihood principle under the normal linear regression model. This connection is useful for understanding the statistical properties of OLS.

The lecture next covers generalized M-estimators, which provide robust estimates and quantile regression estimates — these extend the framework beyond normal assumptions.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent