Regression Analysis
Regression models how one variable relates to others. Learn linear regression, beta, R squared, multiple regression for factors, hedge ratios and common pitfalls.
Regression analysis estimates how one variable, such as a stock's return, relates to one or more other variables, such as the market's return or a set of factors. It is one of the most widely used tools in finance: it produces betas, hedge ratios, factor exposures and alpha estimates, and it underpins many forecasting models. Understanding how regression works, and how it can mislead, is essential for quantitative trading and risk management.
Simple linear regression#
y = α + β × x + ε
| Term | Meaning |
|---|---|
| y | Dependent variable (for example, a stock's return) |
| x | Independent variable (for example, the market's return) |
| α (intercept) | Value of y when x is zero; in finance, often called alpha |
| β (slope) | Change in y for a one unit change in x |
| ε (error) | The part of y not explained by x |
Ordinary least squares (OLS) chooses α and β to minimise the sum of squared errors.
β = Cov(x, y) / Var(x)
Worked example: market beta#
Multiple regression#
With several explanatory variables:
y = α + β1 x1 + β2 x2 + ... + βk xk + ε
Factor models use multiple regression to measure exposure to market, size, value, momentum and other factors. A fund's "alpha" is often defined as the intercept after controlling for these factors. See Factor Models.
Uses in trading#
| Use | Example | Lesson |
|---|---|---|
| Beta and hedging | Hedge a stock with index futures | Alpha and Beta |
| Hedge ratios for pairs | Regress one stock's price on another's | Pairs Trading |
| Factor exposures | Measure a portfolio's tilt to value or momentum | Factor Models |
| Performance attribution | Separate skill from factor returns | P&L and Performance Attribution |
| Forecasting | Predict returns from signals | Signal Discovery |
| Cost models | Estimate market impact from order size | Market Impact |
Assumptions and checks#
| Assumption | Problem if violated | Remedy |
|---|---|---|
| Linear relationship | Biased estimates | Transform variables, add terms |
| Independent errors | Understated standard errors | Newey West standard errors. See Autocorrelation and Partial Autocorrelation |
| Constant error variance | Unreliable inference | Robust (heteroskedasticity consistent) standard errors |
| No strong multicollinearity | Unstable coefficients | Remove or combine correlated variables |
| Stationary data | Spurious results | Use returns, not prices; test for cointegration. See Stationarity, Differencing and Unit Roots |
| No extreme outliers | Distorted fit | Robust regression. See Outliers and Robust Statistics |
Spurious regression#
Regressing one trending price series on another can produce high R² and "significant" coefficients even when the series are unrelated. Clive Granger and Paul Newbold showed this in 1974. Use returns or test for cointegration when working with prices. See Cointegration.
Overfitting#
Adding more variables always increases in sample R², even if they are noise. Use adjusted R², information criteria, regularisation (such as ridge and lasso regression) and out of sample tests to avoid overfitting. See Overfitting and Curve Fitting and Model Evaluation and Cross-Validation.
Frequently asked questions#
What is regression analysis in trading?#
A statistical method that estimates how one variable, such as a stock's return, relates to others, such as market or factor returns.
What does beta mean in a regression?#
The slope coefficient: how much the dependent variable changes, on average, for a one unit change in the independent variable.
What is a spurious regression?#
A regression that shows a strong relationship between unrelated variables, often caused by regressing trending, non stationary series on each other.
Next, learn a general method for fitting models in Maximum Likelihood.
3 quick questions on this lesson. Get them all right to finish it.
Turn on JavaScript to take the quiz.
Mentioned in
- Outliers and Robust StatisticsMath and Statistics
- Statistical Significance in TradingMath and Statistics
- Autocorrelation and Partial AutocorrelationMath and Statistics
- Stationarity, Differencing and Unit RootsMath and Statistics
- CointegrationMath and Statistics
- Granger CausalityMath and Statistics