Supply Chain & InventoryFree calculatorPDF, Excel, Word export

Linear Regression Trend Forecast Calculator

When demand drifts steadily up or down, a trend line is the simplest honest forecast. This calculator fits a least squares line to the last six periods and projects it forward, showing slope, intercept and R squared so you can judge whether the line deserves trust.

Your numbers

3 periods

Your results

Trend slope per period
17.2571
Forecast for chosen period
547
Average demand
452
Intercept at period 0
391.6
Total sum of squares
5,538
R squared
0.9411
Share of variation explained by the line.

A straight line extended far ahead can mislead. Check R squared, look for seasonality and use short horizons.

Save results:

Trend forecast by periods ahead

Sweeps Periods ahead to forecast from 1 to 12, holding your other inputs fixed.

Compare models on your data

Optional: we can back-test trend and smoothing models on your ERP demand history.

Optional. The tool and every export work without this. No spam.

How to use it

Enter the six most recent periods of demand, oldest first, and choose how many periods ahead to forecast. The tool computes the slope, which is the average change per period, the intercept and R squared. The primary forecast is the line value at period six plus the number of periods ahead, floored at zero. Use the chart to see how the projection runs over the next twelve periods.

  • Use consistent period lengths
  • Remove one-off spikes first
  • Adjust for seasonality before fitting
  • Keep the horizon short

The method

Ordinary least squares picks the line that minimises squared errors. With periods 1 to 6 the mean of x is 3.5 and the sum of squared deviations of x is 17.5. Slope equals the sum of (x minus 3.5) times y, divided by 17.5. Intercept equals the mean of y minus slope times 3.5. R squared is the explained sum of squares, slope squared times 17.5, divided by the total sum of squares of y.

Reading the example

With the default data, average demand is 452 and the slope is about 17 units per period, so demand is rising roughly 3.7% per period. R squared is above 0.9, so most variation is explained by the line. Three periods ahead the forecast is about 538. If R squared were 0.3 the slope would be mostly noise and a flat average or exponential smoothing would be more sensible.

Common mistakes

Fitting a line through seasonal data and calling the result a trend is the most frequent error. Six points are few, so a single outlier moves the slope. Extrapolating twelve periods from six is aggressive. Also, a trend that is true in units may be wrong after a lifecycle event such as a price change or a competitor entry, so combine it with sales knowledge.

Frequently Asked Questions

What does R squared tell me here?

It is the share of the variation in demand explained by the straight line. Close to 1 means a strong linear trend. Low values mean the line adds little over a simple average.

How many periods should I use?

Six is a minimum for a quick check. For a stable estimate use 12 to 24 periods, and deseasonalise first if demand has a seasonal pattern.

Why is the forecast floored at zero?

A falling trend can project negative demand, which is impossible. The floor avoids that, but it is also a signal that the straight line no longer describes the item.

How does this differ from exponential smoothing?

Regression weights all six periods equally and assumes a constant slope. Holt style smoothing weights recent periods more and lets the slope change over time.

Netray can run trend, seasonality and smoothing models on your ERP history side by side and show which fits each item best.