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:

Forecasting using linear regression

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 ...

Get MDX with Microsoft SQL Server 2016 Analysis Services Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.