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
Your results
A straight line extended far ahead can mislead. Check R squared, look for seasonality and use short horizons.
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.
Related Tools
Demand Variability CV and XYZ Classification Calculator
Turn mean demand, standard deviation and average demand interval into a CV, an XYZ class and a Syntetos-Boylan demand pattern so you can pick the right forecast method.
Supply Chain & InventoryMAD to Safety Stock Forecast Error Calculator
Use your measured mean absolute deviation of forecast error to set safety stock and reorder point instead of a guessed buffer.
Supply Chain & InventoryStatistical vs Sales Forecast Blend Calculator
Weight the statistical forecast and the sales or customer forecast by how accurate each has been, and see the consensus number and the gap between sources.
Supply Chain & InventoryNew Product Launch Demand Ramp Calculator
Plan a launch with no history: ramp to peak, total demand over the horizon, channel pipeline fill and a suggested initial build quantity.
More Supply Chain & Inventory tools
See all- Oracle Fusion Inventory Turns and Carrying Cost Calculator
- Distribution ERP Fill Rate Calculator
- Distributor Rebate Tracking Worksheet
- Branch Transfer Planning Worksheet
- Distributor Slow-Moving Inventory Review Worksheet
- Distributor Vendor Performance Scorecard Worksheet
- Distributor GMROI Calculator
- Distributor Backorder Cost and Fill Rate Calculator
- EOQ with Vendor Minimum Order Calculator