How to derive B0 and B1 in linear regression-part-1?

Induraj
3 min readFeb 20, 2023

--

Below is the simple explanation, Check part-2 for more detailed steps in deriving the B0 and B1. Link for part 2 →How to derive B0 and B1 — PART-2.

Other related articles:

Which Metrics in Regression matter the most? MSE|RMSE|MAE|R2|Adj R2- Advantages/Disadvantages (click here)

In linear regression, we try to find the line of best fit that explains the relationship between two variables x and y. The line of best fit is given by the equation:

y = B0 + B1*x

where B0 is the y-intercept and B1 is the slope of the line.

To derive B0 and B1, we need to minimize the sum of squared errors between the actual y values and the predicted y values for a given set of x values. The sum of squared errors is given by:

SSE = Σ(y — ŷ)²

where y is the actual y value, ŷ is the predicted y value, and Σ is the sum over all the data points.

In linear regression, our primary objective is to minimize the SSE. So we take the derivative of the SSE with respect to B0 and B1 and set them equal to 0.

Derivation of B0:

To find the value of B0 that minimizes SSE, we take the partial derivative of SSE with respect to B0 and set it equal to 0:

Derivation of B1:

To find the value of B1 that minimizes SSE, we take the partial derivative of SSE with respect to B1 and set it equal to 0:

So, B1 is the slope of the line of best fit, which tells us how much y changes for a given change in x. B0 is the y-intercept of the line of best fit, which tells us the value of y when x is zero.

In summary, we use linear regression to find the line of best fit that explains the relationship between two variables x and y. We derive B0 and B1 by minimizing the sum of squared errors between the actual y values and the predicted y values, and we use B0 and B1 to determine the slope and y-intercept of the line of best fit.

Check part-2 for more detailed steps in deriving the B0 and B1. Link for part 2 — >How to derive B0 and B1 — PART-2

Other related articles:

Which Metrics in Regression matter the most? MSE|RMSE|MAE|R2|Adj R2- Advantages/Disadvantages (click here)

--

--