Prediction using linear regression
Linear regression is one of the most widely known modeling techniques. Existing for more than 200 years, it has been explored from almost all possible angles. Linear regression assumes a linear relationship between the input variable (X) and the output variable (Y). It involves finding a linear equation for predicted value Y of the form:
Yhat = WTX + b
Where X = {x1, x2, ..., xn} are the n input variables, and W = { w1, w2, ...wn} are the linear coefficients, with b as the bias term. The bias term allows our regression model to provide an output even in the absence of any input; it provides us with an option to shift our data left or right to better fit the data. The error between the observed values (Y) and predicted values (Yhat) for an input sample i is:
ei = Yi - Yhati
The goal is to find the best estimates for the coefficients W and bias b, such that the error between the observed values Y and the predicted values Yhat is minimized...