Forecasting using linear regression
This recipe illustrates the method of estimating the future values based on a linear trend. The linear trend is calculated using the least-square distance, a statistical method of determining the line that fits the best through the set of values in the chart, as displayed in the following figure:
Mathematically, linear regression can be represented by a regression line, y = ax + b, where y is the value of the y-intercept for a value of x.
Linear regression is often used in a way that x is a period and y is the value in a particular time, for example, a month.
Most importantly, the regression line is used to forecast ...