Linear Regression
Fitting a line to a dataset of observations
Simple linear regression
sometimes called as regressing onto
Estimating the coefficients
By using least squares which minimizes the sum of squared errors.
Let be the prediction for Y based on the ith value of X. Then represents the ith residual, This is the difference between the ith observed response value and the ith response value that is predicted by our linear model. We define the residual sum of squares (RSS) as
If we minimize RSS by using calculus we get
where and
Accessing accuracy of coefficient estimates
R-Squared
R-Squared is a statistical measure of how close the data are to the fitted regression line. It is also known as the coefficient of determination.
Real world applications
- Predict temperature
- Predict stock price