NewsletterStudioAdvertise
PREMIEUR
Subscribe
PREMIEUR
News
Deals
Funds
Allocators
Learn
Loading
© 2026 Premieur Group Holdings All rights reserved.
AboutSubscribeSupportPrivacyTerms
Learn / Quants and programming / Beta, correlation and regression

Beta, correlation and regression

Premieur Institute · Read time: 16 minutes

Covariance, correlation and beta by ordinary least squares, alpha and R squared, and the CAPM, with a full regression computed by hand on six months of returns.

Contents

Covariance and correlationBeta as a regression slopeResiduals, R squared and the split of riskThe CAPM: from beta to required returnHow much to trust the estimate

When an allocator asks whether a manager has skill, the first step is to strip out what the market did. A fund that returned 15 percent in a year when the market returned 20 percent, with twice the market's sensitivity, did not add value; it lost it. Beta measures that sensitivity, alpha measures what is left over, and regression is the tool that estimates both from a return history.

The same machinery runs through the rest of the buyside. Equity analysts estimate betas to compute a cost of equity in the capital asset pricing model (CAPM). Risk teams use betas to hedge a portfolio's market exposure with index futures. Hedge fund allocators run factor regressions to see how much of a manager's return is really exposure to the market, size, value or momentum.

This topic builds up from covariance and correlation to the regression line, then computes a full regression by hand on a deliberately small, made up set of six monthly returns for one stock and one market index. Six observations are far too few for a real estimate, which is part of the lesson: the final section shows how wide the uncertainty is.

Key takeaways

  • Covariance measures how two return series move together; correlation rescales it to lie between minus 1 and plus 1.
  • Beta is the covariance of the asset with the market divided by the variance of the market, which is exactly the slope of an ordinary least squares regression of asset returns on market returns.
  • Alpha is the regression intercept: the average return not explained by market exposure. It is an estimate with a standard error, and is usually far less certain than beta.
  • R squared is the share of the asset's variance explained by the market, and in a one factor regression equals the correlation squared.
  • The CAPM turns beta into a required return: risk free rate plus beta times the equity risk premium.

Covariance and correlation

Covariance measures whether two series tend to be above their means at the same time. For each period, multiply the asset's deviation from its mean by the market's deviation from its mean; average those products (dividing by n minus 1 for a sample). A positive covariance means the two usually move in the same direction, a negative one means they usually move in opposite directions, and a value near zero means there is no linear relationship.

Covariance is hard to read on its own because its units are the product of the two series' units, percent squared for returns, and its size depends on how volatile each series is. Correlation fixes that by dividing the covariance by the product of the two standard deviations. The result is a pure number between minus 1 and plus 1. A correlation of 0.87 says the two series move together closely; it says nothing about how much one moves when the other does.

That last point is the most common confusion in this area. Correlation measures how tightly two series line up; beta measures how much one moves per unit move in the other. A small cap stock can have a correlation of 0.6 with the index and a beta of 1.5, while a utility can have a correlation of 0.6 and a beta of 0.5. The difference is volatility: beta equals correlation multiplied by the ratio of the asset's volatility to the market's.

Sample covariance and correlation
cov(S, M) = sum of (Si - mean S) x (Mi - mean M) / (n - 1) corr(S, M) = cov(S, M) / (sS x sM)
Si, Mi
Asset (stock) and market returns in period i
sS, sM
Sample standard deviations of the asset and market returns
n
Number of paired observations
Illustrative stock S and market M: six monthly returns in percent, with the regression building blocks
MonthMarket MStock SM - mean MS - mean SProduct(M - mean M)^2(S - mean S)^2
12311.51.512.25
2-1-1-2-2.55.046.25
33220.51.040.25
4-2-4-3-5.516.5930.25
54634.513.5920.25
603-11.5-1.512.25
Sum690036.02861.50
Mean M = 6 / 6 = 1.0 percent. Mean S = 9 / 6 = 1.5 percent. All numbers are made up so the arithmetic is easy to follow.
Worked example

Covariance and correlation of S and M

  • The sums in the table: sum of products 36.0, sum of squared market deviations 28, sum of squared stock deviations 61.5, n = 6.
  1. 1. Covariance
    36.0 / (6 - 1) = 7.2
    7.2 (% squared)
  2. 2. Market variance and volatility
    28 / 5 = 5.6; sqrt(5.6) = 2.3664
    2.37% per month
  3. 3. Stock variance and volatility
    61.5 / 5 = 12.3; sqrt(12.3) = 3.5071
    3.51% per month
  4. 4. Correlation
    7.2 / (2.3664 x 3.5071) = 7.2 / 8.2993 = 0.8675
    0.87

Stock S moves closely with the market (correlation 0.87) and is about one and a half times as volatile (3.51 against 2.37 percent a month).

Beta as a regression slope

Beta is the slope of the line that best fits the asset's returns plotted against the market's. 'Best' in ordinary least squares (OLS) means the line that minimises the sum of squared vertical distances between each observation and the line. Solving that minimisation gives a neat result: the slope is the covariance of the asset with the market divided by the variance of the market. So beta, as a risk concept, and the OLS slope, as a statistical one, are the same number.

A beta of 1 means the asset tends to move one for one with the market. A beta above 1 amplifies market moves, typical of cyclical, highly leveraged or small companies; a beta below 1 dampens them, typical of utilities and consumer staples. A beta of zero does not mean an asset is riskless, only that its risk is unrelated to the market. A market neutral hedge fund aims for a beta near zero precisely so that its returns reflect stock selection rather than market direction.

Practical beta estimates are sensitive to choices that have nothing to do with the company: the index used as the market, the return frequency (daily, weekly, monthly), and the window (commonly two years of weekly or five years of monthly data). Data vendors also publish 'adjusted' betas that shrink the raw estimate toward 1, commonly two thirds raw plus one third times 1, on the evidence that extreme betas tend to drift back toward the average over time.

Beta and alpha by OLS
S = alpha + beta x M + e beta = cov(S, M) / var(M) = corr(S, M) x sS / sM alpha = mean S - beta x mean M
beta
Slope: the expected change in the asset return per 1 point change in the market return
alpha
Intercept: the average asset return not explained by market exposure
e
Residual: the part of each period's return the line does not explain
For CAPM work, regress excess returns (asset minus risk free rate on market minus risk free rate). With a stable risk free rate, the beta is nearly identical either way.
Worked example

Beta and alpha of stock S

  • Covariance 7.2 and market variance 5.6 from the previous example. Mean S = 1.5 percent, mean M = 1.0 percent per month.
  1. 1. Beta from covariance
    7.2 / 5.6 = 1.2857
    1.29
  2. 2. Same beta from the sums
    36 / 28 = 1.2857
    1.29
    The n minus 1 terms cancel.
  3. 3. Same beta from correlation
    0.8675 x 3.5071 / 2.3664 = 1.2857
    1.29
  4. 4. Alpha
    1.5 - 1.2857 x 1.0 = 0.2143
    0.21% per month
  5. 5. Alpha, simple annualised
    0.2143% x 12 = 2.57%
    2.57% per year
  6. 6. Fitted line
    S = 0.2143 + 1.2857 x M
    Regression equation

Stock S has a beta of 1.29: when the market rises 1 percent, S tends to rise about 1.29 percent. On this sample it also shows an alpha of about 0.21 percent a month, which the final section tests for significance.

Residuals, R squared and the split of risk

Once the line is fitted, each observation splits into the part the market explains (alpha plus beta times the market return) and a residual. R squared is one minus the ratio of the residual sum of squares to the total sum of squares of the asset's returns around their mean. It is the share of the asset's variance explained by the market, and in a regression with one explanatory variable it equals the correlation squared.

The same split applies to risk. Total variance equals systematic variance (beta squared times the market variance) plus idiosyncratic variance (the variance of the residuals). Systematic risk cannot be diversified away by holding more stocks, because every stock shares it; idiosyncratic risk largely can. That distinction is the foundation of the CAPM and of the portfolio construction topic that follows.

Single stocks typically have R squared values against a broad index somewhere between 0.2 and 0.6 on monthly data; diversified equity funds often exceed 0.9. The 0.75 in this example is high for a single stock, which is a feature of the small made up sample. For a hedge fund, a high R squared against an equity index says most of its returns are market exposure, which should be priced as cheap beta rather than expensive alpha.

R squared and the variance split
R^2 = 1 - SSE / SST = corr(S, M)^2 var(S) = beta^2 x var(M) + var(e)
SSE
Sum of squared residuals
SST
Total sum of squared deviations of the asset return from its mean
var(e)
Idiosyncratic variance: the variance of the residuals
Fitted values and residuals for stock S, in percent
MonthMarket MStock SFitted 0.2143 + 1.2857 x MResidualResidual squared
1232.78570.21430.0459
2-1-1-1.07140.07140.0051
3324.0714-2.07144.2908
4-2-4-2.3571-1.64292.6990
5465.35710.64290.4133
6030.21432.78577.7602
Sum0.000015.2143
OLS residuals always sum to zero when the regression includes an intercept.
Worked example

R squared and the split of risk for stock S

  • SSE = 15.2143 from the table. SST = 61.5 from the first table. Beta 1.2857, market variance 5.6, stock variance 12.3.
  1. 1. R squared from sums of squares
    1 - 15.2143 / 61.5 = 1 - 0.2474 = 0.7526
    0.753
  2. 2. R squared from correlation
    0.8675^2 = 0.7526
    0.753
  3. 3. Systematic variance
    1.2857^2 x 5.6 = 1.6531 x 5.6 = 9.2571
    9.26
  4. 4. Idiosyncratic variance
    15.2143 / 5 = 3.0429
    3.04
    Divided by n minus 1 to match the total variance.
  5. 5. Check the split
    9.2571 + 3.0429 = 12.30
    Equals the stock variance

About 75 percent of stock S's variance comes from the market and 25 percent is specific to the company, the part a diversified portfolio would largely shed.

The CAPM: from beta to required return

The capital asset pricing model says that in equilibrium investors are rewarded only for systematic risk, because idiosyncratic risk can be diversified away at no cost. The expected return on any asset is therefore the risk free rate plus its beta times the market's expected excess return, the equity risk premium (ERP). Plotted against beta, this relationship is a straight line called the security market line.

In practice the CAPM is used in two directions. Forward, it produces a cost of equity for a discounted cash flow valuation or a hurdle rate for an investment committee: plug in today's risk free rate, an estimate of the ERP and the asset's beta. Backward, it defines alpha: if a manager's realised return beats what the CAPM predicts for the beta taken, the excess is Jensen's alpha, which is the regression intercept when the regression is run on excess returns.

The model's empirical record is mixed. Low beta stocks have historically earned more than the CAPM predicts and high beta stocks less, and factors such as size, value and momentum explain returns that beta does not. Practitioners therefore treat the CAPM as a disciplined starting point for a cost of equity rather than a precise forecast, and use multi factor regressions when evaluating managers.

CAPM
E(Ri) = Rf + beta_i x (E(Rm) - Rf)
E(Ri)
Expected (required) return on asset i
Rf
Risk free rate
beta_i
Beta of asset i against the market portfolio
E(Rm) - Rf
Equity risk premium
Worked example

Cost of equity for stock S

  • Illustrative inputs: risk free rate 4.0 percent, equity risk premium 5.0 percent, beta 1.2857 from the regression above.
  1. 1. Risk premium for S
    1.2857 x 5.0% = 6.43%
    6.43%
  2. 2. Required return
    4.0% + 6.43% = 10.43%
    10.43%
  3. 3. With a beta of 1.0 instead
    4.0% + 1.0 x 5.0% = 9.0%
    9.0%
    The extra 1.43 points is the price of S's higher market sensitivity.

On these inputs the CAPM requires 10.43 percent a year from stock S. Every 0.1 of beta moves the required return by half a point, so the beta estimate deserves as much scrutiny as the ERP.

How much to trust the estimate

Regression output always comes with standard errors, and they are not optional reading. The standard error of beta is the residual standard deviation divided by the square root of the sum of squared market deviations. The standard error of alpha is larger relative to its size, because alpha is a small number estimated from noisy data. The t statistic, the estimate divided by its standard error, says how many standard errors the estimate sits away from zero.

For stock S, beta has a t statistic of about 3.5, which with four degrees of freedom (six observations minus two estimated parameters) clears the 5 percent critical value of 2.776. Alpha has a t statistic of about 0.24, indistinguishable from zero. The six months tell us, weakly, that S has market exposure. They tell us nothing at all about whether S outperforms.

This asymmetry holds for real managers too. Betas can be estimated reasonably well from a few years of data; alphas generally cannot. A manager with a true alpha of 2 percent a year and 8 percent of residual volatility needs, by the same arithmetic, many years of data before the alpha is statistically distinguishable from luck. That is why serious allocators combine the regression with a qualitative view of the process that generates the returns.

Standard errors in a one factor regression
s_e = sqrt(SSE / (n - 2)) SE(beta) = s_e / sqrt(Sxx) SE(alpha) = s_e x sqrt(1/n + mean M^2 / Sxx)
s_e
Residual standard error
Sxx
Sum of squared deviations of the market return from its mean
n - 2
Degrees of freedom: observations minus the two estimated parameters
Worked example

Is the beta of S significant? Is the alpha?

  • SSE = 15.2143, Sxx = 28, n = 6, mean M = 1.0. Beta 1.2857, alpha 0.2143.
  1. 1. Residual standard error
    sqrt(15.2143 / 4) = sqrt(3.8036) = 1.9503
    1.95%
  2. 2. Standard error of beta
    1.9503 / sqrt(28) = 1.9503 / 5.2915 = 0.3686
    0.37
  3. 3. t statistic of beta
    1.2857 / 0.3686 = 3.49
    3.49
  4. 4. Standard error of alpha
    1.9503 x sqrt(1/6 + 1/28) = 1.9503 x sqrt(0.2024) = 0.8774
    0.88%
  5. 5. t statistic of alpha
    0.2143 / 0.8774 = 0.24
    0.24

Beta is significant at the 5 percent level (3.49 against a critical value of 2.776); alpha is not (0.24). The apparent 2.6 percent a year of alpha is noise on this sample.

Where this goes wrong

Reading an intercept as skill

A positive alpha in a short regression is the most quoted and least reliable number in a manager pitch. Always ask for its t statistic, the number of observations and the benchmark used. An alpha against the wrong benchmark, for example a small cap manager regressed on a large cap index, usually reflects omitted factor exposure rather than skill.

Watch for non linear exposures as well. A fund that sells index options can show a low beta and a positive alpha in calm periods, then a much higher beta in a selloff. Regressions on up market and down market months separately will often reveal it.

Beta, alpha and R squared for stock S with numpyPython
import numpy as np

# Illustrative monthly returns, as decimals
m = np.array([2, -1, 3, -2, 4, 0]) / 100
s = np.array([3, -1, 2, -4, 6, 3]) / 100

beta = np.cov(s, m)[0, 1] / np.var(m, ddof=1)
alpha = s.mean() - beta * m.mean()
corr = np.corrcoef(s, m)[0, 1]

print(f"beta        {beta:.4f}")
print(f"alpha       {alpha:.4%} per month")
print(f"correlation {corr:.4f}")
print(f"R squared   {corr ** 2:.4f}")
Output
beta        1.2857
alpha       0.2143% per month
correlation 0.8675
R squared   0.7526
np.cov uses n minus 1 by default, while np.var uses n unless ddof=1 is passed. Mixing the two defaults is a classic source of a beta that is off by a factor of (n - 1) / n.

Templates for this lesson

Included with a Premieur membership.

  • NotebookFactor regression notebookA fund's excess returns on market, size, value and momentum: betas, alpha, t statistics, R squared and the attribution.Download
Go deeper with Membership →