Simple Linear Regression
Simple Linear Regression is where we only have one predictor variable. When we have a combination of predictor variables, then the prediction method is called multiple regression.
Link to original
Linear Assumption
When working with linear regression models, we take the linear assumption: the relationship between the input and output is linear. It does not support anything else.
Link to original
We must also not have too noisy data as outliers in data sets can be problematic.
Simple Linear Regression
The ‘best fitting’ line is called the regression line. It shows the predicted score on for each possible value of .
Vertical dashed lines represent the errors of prediction. Prediction error is also called residual. The error of prediction is the difference in -value between the point and the regression line.

We calculate the best fitting line by the sum of squared errors, i.e. the line with the smallest SSE is the ‘best fit’ for the data.

Computing Regression Function
Now that we have the best fitting line, we can produce the function (predictive model). The formula is: Where is the y-intercept. Where is the slope of the line.
Minimising the SSE:
It is not efficient to compute the sum of the squared prediction errors for an infinite number of possible lines, so in reality we use two formulas for the intercept and slope to find the equation of the line that minimises the SSE:
And then: