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 i. For each case, there is a single dependent variable (or response variable) yi — the variable of focus. Together with that, there are explanatory variables (or independent variables) xi,1,xi,2,…,xi,p.
Example: yi could be stock returns; explanatory variables could be underlying stock characteristics.
Example: yi 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:
Ordinary Least Squares (OLS) – a purely mathematical criterion for specifying regression models
Gauss-Markov Theorem – introduces weak statistical modeling principles
Normal Linear Regression Models – formal models with distributional assumptions
Extensions – generalized estimators, robust methods, etc.
Mathematical Formulation
The linear model attempts to model the conditional distribution of the response variable yi given the independent variables xi. It is written as:
The β's are the regression parameters defining the linear relationship. The ϵ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 i index time points; independent variables can include lags of the response variable (autoregressive models), widely used in finance
Steps for Fitting a Regression Model
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.
Specify assumptions about the distribution of the residuals ϵi: This includes assumptions about their means, variances, and correlations.
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
Characterize the best estimator and apply it to the data.
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.
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]=0 (no systematic bias)
Constant variance: Var(ϵi)=σ2 (homoscedasticity)
Uncorrelated errors: Cov(ϵi,ϵj)=0 for i=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: ϵ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 n-vector of random variables Y=(Y1,…,Yn)T, the expectation is E[\mathbf{Y}] = (\mu_1, \ldots, \mu_n)^T\). The **covariance matrix** is ann \times nmatrixwithithdiagonalentry\text{Var}(Y_i)and(i,j)entry\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, the least squares criterion is:
where y^i=xiTβ is the linear prediction.
The ordinary least squares (OLS) estimate β^ minimizes Q(β).
Matrix Formulation
Let y be the n-vector of response variables, and let X be the n×p matrix of independent variables (rows = cases, columns = variables). Then:
Taking the derivative with respect to β (a vector) and setting to zero gives the normal equations:
If XTX is invertible, the OLS estimate is:
When is XTX Invertible?
X must have full column rank (rank p). This means no column of X can be expressed as a linear combination of the others. If rank is less than p, the OLS estimate may be non-unique, but predictions can still be made.
Fitted Values and the Hat Matrix
The fitted values are:
The hat matrix H=X(XTX)−1XT is an orthogonal projection matrix that projects y onto the column space of X.
Residuals are:
The matrix In−H projects y onto the space orthogonal to the column space of X. The normal equations imply that XTϵ^=0, i.e., the residual vector is orthogonal to every column of X.
The Gauss-Markov Theorem
Now introduce probability: the observed y is a realization of a random vector Y=(Y1,…,Yn)T.
Gauss-Markov assumptions (conditional on X and β):
E[Y∣X,β]=Xβ
Cov[Y∣X,β]=σ2In (constant variance and uncorrelated errors)
Consider estimating a linear combination of the regression parameters:
where a is a known p-vector. This is general enough to cover predictions (e.g., the expectation of y for a new x).
The OLS estimator θ^=aTβ^ is:
Unbiased: E[θ^]=θ
Linear: θ^ is a linear combination of the yi's (since β^ is linear in y)
The Gauss-Markov Theorem: Under the Gauss-Markov assumptions, θ^=aTβ^ has the smallest variance among all linear unbiased estimators of θ. It is the BLUE (Best Linear Unbiased Estimator).
Proof Sketch
Consider any other linear unbiased estimator θ~=cTy. Write c=d+f, where d is in the column space of X (so dTy corresponds to OLS part) and f is orthogonal to that space. Unbiasedness forces f to be orthogonal to X as well. Then:
The covariance term is zero because f is orthogonal to the column space and Cov(Y)=σ2I. Hence Var(θ~)=Var(θ^)+σ2∥f∥2≥Var(θ^), with equality only if f=0.
Generalized Least Squares (GLS)
Generalized Gauss-Markov assumptions: residuals still have zero mean, but the covariance matrix is Cov(ϵ)=σ2Σ, where Σ is a known n×n positive definite matrix (allowing unequal variances and correlations). The model is:
Transformation to Standard Form
Since Σ is positive definite, we can write Σ=Σ1/2(Σ1/2)T. Define:
Y∗=Σ−1/2Y
X∗=Σ−1/2X
ϵ∗=Σ−1/2ϵ
Then E[ϵ∗]=0 and Cov(ϵ∗)=σ2In, so the transformed model satisfies the original Gauss-Markov assumptions.
The GLS estimator is obtained by applying OLS to the transformed data:
Observations with larger variances are down-weighted by the Σ−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). Then, conditioning on X and β:
where Nn denotes an n-variate normal distribution with mean vector Xβ and covariance matrix σ2In.
Moment Generating Function for Multivariate Normal
For an n-variate random vector Y with mean μ and covariance Σ, the moment generating function (MGF) is:
For the normal regression model, μ=Xβ and Σ=σ2I.
Distribution of OLS Estimator
The OLS estimator is β^=(XTX)−1XTY. This is a linear transformation of Y. Using the MGF approach, we can derive its distribution. For any vector τ∈Rp, the MGF of β^ is:
This is the MGF of a multivariate normal distribution. Hence:
In particular, the marginal distribution of each β^j is:
To see this, set τ to have a single non-zero component (the jth), and the resulting MGF is univariate normal.
QR Decomposition
Any n×p matrix X (with n≥p) can be decomposed as:
where Q is an n×p matrix with orthonormal columns (QTQ=Ip) and R is a p×p upper triangular matrix.
The decomposition can be obtained by Gram-Schmidt orthonormalization:
First column: r11=∥X1∥, Q1=X1/r11
Subsequent columns: for j>1, r1j=Q1TXj, then orthogonalize Xj against Q1; continue.
With the QR decomposition:
The OLS estimate simplifies: β^=R−1QTy
The hat matrix: H=QQT
The covariance matrix: Cov(β^)=σ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), then for any matrix Am×n, the transformed vector Z=AY is also normal:
This is a direct consequence of the MGF.
Independence of β^ and Residuals
In the normal linear regression model, β^ and ϵ^ are independent random variables. This follows because β^ is a linear function of Y and ϵ^=(I−H)Y. Their covariance is zero:
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)2. Then:
where χn−p2 is a chi-squared random variable with n−p degrees of freedom. (A χk2 is the sum of k independent squared standard normal variables.)
t-Distributions for Coefficients
For each coefficient j, we have:
where cjj=[(XTX)−1]jj. If we estimate σ2 by s2=SSE/(n−p), then:
a Student's t distribution with n−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:
Maximizing L is equivalent to minimizing the negative log-likelihood:
For a fixed σ2, minimizing this is equivalent to minimizing the sum of squares. Therefore, the OLS estimator β^ is also the maximum likelihood estimator under normality.
The ML estimate of σ2 is σ^2=SSE/n, which differs slightly from the unbiased estimator 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.