Linear Regression — Derivation of slope and Intercept using Ordinary Least Square.

Tahera Firdose
9 min readJun 7, 2023

Regression analysis is an essential technique in the world of statistics and data analysis that helps us understand the relationship between variables and make predictions. In this article, the aim is to provide a comprehensive explanation of the fundamental mathematical principles involved in constructing a basic linear model from the ground up.

What is the goal of Linear Regression?

Linear regression aims to identify the relationship between a dependent variable and independent variables. Its primary objective is to find the best-fit line by minimizing the error between observed and predicted values. The goal is to minimize the difference or distance between data points and the line, known as the “error” or “residual,” ensuring accurate predictions and a representative model of the variable relationship.

The slope (m) and intercept (b) in linear regression represent the parameters that determine the characteristics of the best-fit line. The slope determines the rate of change of the dependent variable with respect to the independent variable, while the intercept represents the value of the dependent variable when the independent variable is zero. These parameters are crucial in defining the relationship between the variables and constructing the linear…

--

--

Tahera Firdose

Datascience - Knowledge grows exponentially when it is shared