Skip to content

CFA Level I Exam · Applications of Simple Linear Regression in Finance

OLS Estimation of Slope and Intercept Explained

Updated 7 October 2026 · Fact-checked

Ordinary least squares picks the line Ŷ = b0 + b1X that makes the sum of squared residuals as small as possible. The slope is b1 = Cov(X, Y) ÷ Var(X). The intercept is b0 = Ȳ − b1 × X̄, so the line always passes through the point of means. Find the slope first, then the intercept.

Understand Ordinary Least Squares Estimation of Slope and Intercept

Simple linear regression links a dependent variable Y to one independent variable X with a line: Ŷ = b0 + b1X. For each observation, the residual is the actual Y minus the fitted Ŷ. It is the part of Y that the line misses.

Many lines could be drawn through a scatter of points. Ordinary least squares (OLS) chooses the one that minimises the sum of squared residuals (also called the sum of squared errors). Squaring stops positive and negative errors from cancelling. It also penalises large misses more than small ones.

Solving that minimisation gives two clean results. The slope b1 is the covariance of X and Y divided by the variance of X. It tells you how much Y is expected to change for a one-unit change in X. The intercept b0 is the value of Ŷ when X is zero. It is found by forcing the line through the point (X̄, Ȳ).

Two facts follow. The OLS residuals always sum to zero, and the fitted line always passes through (X̄, Ȳ). Neither fact says the fit is good. Fit is judged with R² and the standard error of estimate, which are covered in other topics.

The slope can also be written as b1 = r × (s_Y ÷ s_X), where r is the correlation. This shows why the slope has the same sign as the correlation. The two measures differ in scale: correlation is unit-free, while the slope carries the units of Y per unit of X.

Key formulas to remember

OLS objective
Minimise Σ(Yi − b0 − b1Xi)²
The sum of squared residuals. OLS chooses b0 and b1 to make this as small as possible.
Slope coefficient
b1 = Cov(X, Y) ÷ Var(X) = Σ(Xi − X̄)(Yi − Ȳ) ÷ Σ(Xi − X̄)²
X is the independent variable and goes in the denominator. If you use sample covariance and variance, use the same divisor (n − 1) for both. The divisor then cancels.
Intercept
b0 = Ȳ − b1 × X̄
Calculate the slope first. This forces the line through the point of means.
Slope from correlation
b1 = r × (s_Y ÷ s_X)
Useful when you are given the correlation and the two standard deviations.
Residual
ei = Yi − Ŷi = Yi − (b0 + b1Xi)
OLS residuals sum to zero when the model includes an intercept.
Fitted value
Ŷ = b0 + b1X
Use it to predict Y for a given X.

How to solve Ordinary Least Squares Estimation of Slope and Intercept questions

Use this order for any question that asks for the OLS slope, intercept or fitted value. Identify X and Y before you touch a number.

  1. 1Identify the dependent variable Y (the one being explained) and the independent variable X (the explanatory one). Check the wording: 'regress Y on X'.
  2. 2List what you are given: raw data, or summary figures such as Cov(X, Y), Var(X), the means, or r with the standard deviations.
  3. 3Compute the slope: b1 = Cov(X, Y) ÷ Var(X). With raw data, find Σ(Xi − X̄)(Yi − Ȳ) and Σ(Xi − X̄)². If you only have r, use b1 = r × s_Y ÷ s_X.
  4. 4Compute the intercept: b0 = Ȳ − b1 × X̄. Keep the sign of b1 and the units of the means.
  5. 5Write the line Ŷ = b0 + b1X. If asked, substitute the given X to get the fitted value.
  6. 6Sanity check: the slope's sign should match the sign of the covariance or correlation, and the line should pass through (X̄, Ȳ).
  7. 7Match your answer to one of the three options. Eliminate options that use the wrong variable as the denominator or that drop the intercept's sign.

Quickest way: Slope first, then plug in the means

When to use it: Use it when the question gives covariance, variance and means, or raw data of four to six points. It saves time compared with expanding sums.

  1. Write b1 = Cov ÷ Var(X) and divide at once.
  2. Write b0 = Ȳ − b1 × X̄ and substitute the means.
  3. With raw data, work in deviations from the means. The products and squares are smaller numbers.
  4. On the TI BA II Plus: press 2nd DATA, then 2nd CLR WRK. Enter X01 and press ENTER, then press ↓. Enter Y01 and press ENTER, then press ↓. Press ↓ again to move past the count field if it appears, and repeat for each point. Always confirm each entry with ENTER before pressing ↓. Press 2nd STAT until the display shows LIN, then press ↓ to scroll. 'a' is the intercept, 'b' is the slope and 'r' is the correlation.
  5. On the HP 12C: clear statistics with f CLEAR Σ. For each point, key y, ENTER, x, then Σ+. Press 0 g ŷ,r to read the intercept. Press 1 g ŷ,r and subtract the intercept to read the slope.
  6. With three options, use the sign and size of the slope to remove two options before you calculate in full.

Common mistakes in Ordinary Least Squares Estimation of Slope and Intercept

  • Swapping X and Y, so the slope is Cov(X, Y) ÷ Var(Y).

    Candidates forget which variable is being explained, or read 'regress X on Y' too fast.

    Fix: The variable in the denominator is always the independent variable. Underline Y and X in the stem before calculating.

  • Computing the intercept as Ȳ + b1 × X̄ or X̄ − b1 × Ȳ.

    The formula is memorised loosely and the sign is lost.

    Fix: Rearrange from Ŷ = b0 + b1X at the means: Ȳ = b0 + b1X̄, so b0 = Ȳ − b1X̄.

  • Mixing a sample covariance with a population variance, or using n for one and n − 1 for the other.

    The two figures come from different parts of a question.

    Fix: Both must use the same divisor. If they do not, adjust one before dividing.

  • Saying OLS minimises the sum of the residuals or the sum of absolute residuals.

    The word 'least' suggests a simple sum.

    Fix: OLS minimises the sum of squared residuals. The plain sum of OLS residuals is zero by construction.

  • Treating the slope as the correlation, or reading a large slope as a strong fit.

    Both measure a relationship and both share the same sign.

    Fix: The slope depends on units and on s_Y ÷ s_X. Fit is shown by r or R². Use b1 = r × s_Y ÷ s_X to link them.

  • Interpreting the intercept as meaningful when X = 0 is outside the data range.

    Candidates read the intercept literally.

    Fix: The intercept is a mathematical anchor for the line. It may have no economic meaning if X = 0 is not realistic.

Worked examples

Example 1

An analyst regresses Y on X using four observations. X values: 2, 4, 6, 8. Y values: 5, 9, 10, 16. The OLS intercept is closest to: A) 1.5, B) 8.5, C) 10.0.

Show the solution
  1. Means: X̄ = (2 + 4 + 6 + 8) ÷ 4 = 5. Ȳ = (5 + 9 + 10 + 16) ÷ 4 = 10.
  2. Deviations of X: −3, −1, 1, 3. Deviations of Y: −5, −1, 0, 6.
  3. Cross-products: (−3)(−5) = 15; (−1)(−1) = 1; (1)(0) = 0; (3)(6) = 18. Sum = 34.
  4. Squared X deviations: 9 + 1 + 1 + 9 = 20.
  5. Slope: b1 = 34 ÷ 20 = 1.7.
  6. Intercept: b0 = 10 − 1.7 × 5 = 10 − 8.5 = 1.5.
  7. Option B (8.5) is the product b1 × X̄ and option C (10.0) is Ȳ. Both are traps.

Answer: The intercept is 1.5 (with slope 1.7), so the answer is A.

Example 2

A stock's returns are regressed on market returns. The covariance of the two return series is 0.0072 and the variance of market returns is 0.0045. The mean market return is 1.0% and the mean stock return is 1.4%. The regression intercept is closest to: A) −0.2%, B) 0.2%, C) 1.6%.

Show the solution
  1. The stock return is Y and the market return is X.
  2. Slope: b1 = Cov(X, Y) ÷ Var(X) = 0.0072 ÷ 0.0045 = 1.6.
  3. Intercept: b0 = Ȳ − b1 × X̄ = 1.4% − 1.6 × 1.0% = 1.4% − 1.6% = −0.2%.
  4. Option C (1.6) is the slope, not the intercept. Option B has the wrong sign.

Answer: The intercept is −0.2%, so the answer is A.

Exam tips

  • Read which variable is the dependent one first. A swapped denominator is the most common trap in these items.
  • Questions often give Cov(X, Y), Var(X) and the means. Do two lines of arithmetic: slope, then intercept.
  • When a slope option equals Ȳ, X̄ or the product b1 × X̄, treat it as a distractor and check what it represents.
  • Learn the BA II Plus LIN mode (a = intercept, b = slope). It checks small raw-data questions in seconds. Clear old data first, or stale entries will corrupt the result.
  • If an option offers a negative slope and the covariance is positive, eliminate it at once. The signs must match.

Practice questions from Applications of Simple Linear Regression in Finance

Ordinary Least Squares Estimation of Slope and Intercept in other exams

The same ground in other exams, if you are preparing for more than one or want another angle on it.

Ordinary Least Squares Estimation of Slope and Intercept: frequently asked questions

What is the OLS formula for the slope in simple linear regression?

The slope is b1 = Cov(X, Y) ÷ Var(X), or Σ(Xi − X̄)(Yi − Ȳ) ÷ Σ(Xi − X̄)². X is the independent variable. It can also be written as r × s_Y ÷ s_X.

Why does OLS square the residuals?

Squaring stops positive and negative residuals cancelling and gives larger errors more weight. It also produces simple closed-form formulas for the slope and intercept.

Do I need to use n or n − 1 when calculating covariance and variance for the slope?

Either works as long as you use the same divisor for both. The divisor cancels in the ratio. Problems arise only when one figure uses n and the other n − 1.

How do I get the regression line on a financial calculator in the CFA exam?

On the TI BA II Plus, enter the data in the STAT worksheet (2nd DATA) and select LIN mode with 2nd STAT. Then scroll to read a (intercept) and b (slope). On the HP 12C, enter y, ENTER, x, then Σ+ for each point and use g ŷ,r.