On This Page
Key Takeaways
- Regression fits an equation that describes how a dependent variable changes as one or more independent variables change.
- Ordinary least squares chooses the intercept and slopes that minimize the sum of squared residuals, and for one predictor the slope equals covariance divided by the predictor variance.
- In markets, regression produces beta, hedge ratios, factor loadings, and the regression channels drawn on price charts.
- Adding predictors never lowers in-sample R-squared, so judge a bigger model by adjusted R-squared and held-out prediction error.
- Use slopes to size exposure, residuals to see what the fit misses, and a controlled research design for causal questions.
What is regression analysis?
Regression analysis is a statistical method that estimates an outcome from one or more predictors by fitting an equation. Simple linear regression uses one predictor; multiple regression uses several. The fitted equation contains an intercept and predictor coefficients, while residuals record observed minus fitted values. In markets, regression produces beta, hedge ratios, factor loadings and the regression channels drawn on price charts.
Linear means linear in the coefficients. A model can include squared predictors or other transformed inputs and still be a linear regression in that sense.
How is a regression line calculated?
Ordinary least squares minimizes the sum of squared residuals. With one varying predictor and an intercept, the slope is covariance(x, y) / variance(x). The intercept is mean(y) − slope × mean(x).
These formulas fit the line through the sample means. In multiple regression, each coefficient measures the fitted change associated with its predictor while holding the other included predictors fixed.
Formula
y = a + b1*x1 + b2*x2 + ... + e; for a single predictor, b = Cov(x, y) / Var(x) and a = mean(y) − b * mean(x)- y is the dependent variable being explained, and × is an independent variable used to explain it.
- a is the intercept, the fitted value of y when every predictor equals zero.
- b is the slope, the modeled change in y for a one-unit change in × with other predictors held fixed.
- e is the residual, the part of y the fitted line misses: observed value minus fitted value.
Regression example: beta and a market hedge
A trader estimates the market sensitivity of a single stock by regressing 60 monthly stock returns on 60 monthly returns of a broad index, then uses the result to size an index hedge for a $250,000 position.
- Covariance of stock and index returns: 0.00180
- Variance of index returns: 0.00125
- Slope (beta): 0.00180 / 0.00125 = 1.44
- Intercept: 0.90% − 1.44 * 0.60% = 0.036% average monthly return unexplained by the index
- R-squared of 0.62 leaves 38% of the stock return variance unexplained by the index
- Beta-weighted hedge notional: $250,000 * 1.44 = $360,000 of index exposure
Beta of 1.44 sets the hedge: short $360,000 of index exposure against the $250,000 long stock position. R-squared 0.62 means the hedge strips out the market’s share of the swings and leaves 38% of the return variation, the company-specific and omitted drivers, in the position. The 0.036% intercept comes from raw returns; run the regression on excess returns to read it as Jensen alpha.
With stock and index means of 0.90% and 0.60%, the intercept is 0.90% − 1.44 × 0.60% = 0.036% per month. For Jensen alpha, run the same regression on excess returns.
For a $250,000 long stock position, the estimated first-order index hedge is $250,000 × 1.44 = $360,000 short. The fitted R-squared of 0.62 leaves 38% of sample variation in the residual, which can include omitted common exposures as well as company-specific movement.
Regression channel example on a price chart
The chart fits 24 daily closes against bar index, beginning at zero. The fitted intercept is 99.30 and the slope is 0.65 per bar, with R-squared 0.97.
Residual sum of squares is 15.37. Dividing by 24 − 2 and taking the square root gives a residual standard error of 0.836. The displayed channel uses twice that value above and below the fitted line.
The final close of 115.90 sits 1.61 above its fitted value, or 1.93 residual standard errors, near the top of the ±2 band. The band measures how far price has run from its fitted trend over these 24 bars, so refit it as new bars arrive.
How to choose and check a regression model
Market regression estimates market sensitivity. Factor regression estimates several exposures. A price-level pairs regression supplies a fitted spread; examine its time-series behavior separately before selecting a mean-reversion rule.
Plot the residuals before you trust the fit. Two predictors that move in lockstep leave the regression unable to split their effects, a missing driver that moves with an included predictor pushes its effect into that predictor’s coefficient, and returns whose volatility clusters need robust standard errors before a slope counts as significant.
For nested ordinary least-squares models on one sample, added predictors can improve or leave unchanged the fit. Compare adjusted R-squared and held-out error alongside the actual coefficient estimates.
Limitations of regression
- Treat a slope as association. An omitted variable, reverse causality or a coincidental pattern can produce a large and statistically significant slope, so a trade built on cause needs a reason the link holds.
- Recheck the hedge ratio. A new window, changed holdings or a shifting relationship moves beta, so refit the 1.44 before you roll the $360,000 hedge.
- Use robust standard errors on returns. The classical formula assumes constant error variance and uncorrelated errors, and clustered volatility or autocorrelation breaks both, so call a slope significant only on errors built for that structure.
- Judge added predictors on held-out data. In nested least-squares fits on the same observations, R-squared cannot fall as predictors are added, so a bigger model always looks at least as good in sample; adjusted R-squared and held-out error show whether it predicts better.
- Refit the channel as bars arrive. The ±2 band measures the last 24 closes around their fitted trend, and each new bar moves the line, so set entries and stops off the refit band.
Bottom line
Regression turns paired observations into an equation, which is how traders estimate beta, hedge ratios and factor exposures. Use the slope to size exposure, the residuals to see what the fit misses, and a fresh window or held-out data to check that the relationship still holds.
Clear answers
Frequently Asked Questions
Sources and Further Reading
- NIST/SEMATECH e-Handbook of Statistical Methods: Linear Least Squares Regression
- CFA Institute: Simple Linear Regression (refresher reading)
- CFA Institute: Portfolio Risk and Return, Part II (refresher reading)
How entries are sourced, calculated and updated: editorial methodology.