Trend analysis: fit linear, quadratic and exponential trends

Updated

Trend analysis fits a smooth curve of time to a series, such as monthly orders or weekly scrap, and extends that curve to forecast the next periods. It is the simplest forecasting model: the whole history gets one equation, every point carries the same weight, and there is no seasonal pattern. Use it when the series moves steadily in one direction and you want a clear, explainable projection.

When to use it

  • A time series plot shows a steady rise or fall without a repeating seasonal pattern.
  • You need a forecast a few periods ahead that you can explain with one equation.
  • You want to compare a straight-line trend with a curved one (accelerating or slowing growth).
  • You need a trend line to remove before looking at what is left, for example before a decomposition.

If the series has seasons, use decomposition or Winters' method. If the trend itself drifts over time, smoothing methods such as double exponential smoothing adapt better.

How it works

Number the periods t = 1, 2, …, n and fit one of these models by least squares:

Linear: ŷₜ = b₀ + b₁·t Quadratic: ŷₜ = b₀ + b₁·t + b₂·t² Exponential: ŷₜ = b₀ · b₁ᵗ

The linear model adds the same amount each period. The quadratic adds an amount that grows or shrinks by a constant step, so it can bend up or down. The exponential model grows by the same percentage each period: b₁ = 1.03 means 3% per period. This article fits the exponential model by a straight line on ln(yₜ), which is the usual approach; a direct nonlinear fit gives slightly different coefficients.

Three accuracy measures compare the fits, using the errors eₜ = yₜ − ŷₜ:

MAPE = (100/n) · Σ |eₜ / yₜ| (mean absolute percentage error) MAD = (1/n) · Σ |eₜ| (mean absolute deviation) MSD = (1/n) · Σ eₜ² (mean squared deviation)

Smaller is better for all three. MAPE is in percent, MAD is in the data's units, and MSD punishes large misses more.

Example

A distributor of industrial fasteners tracks orders received per month for two years:

MonthsOrders
1–6475, 385, 461, 451, 465, 482
7–12455, 507, 505, 611, 556, 557
13–18573, 579, 585, 615, 650, 650
19–24693, 684, 706, 757, 753, 749

The three fitted models:

ModelEquationMAPEMADMSD
Linear393.605 + 14.858·t3.6119.47742.2
Quadratic417.777 + 9.280·t + 0.22312·t²3.2417.39651.2
Exponential411.947 × 1.026245ᵗ3.2617.49655.9
Monthly orders with linear and exponential trends400500600700OrdersOrdersLinear trendExponential trend1471013161922Month
Monthly orders with linear and exponential trends

The linear fit leaves a pattern: its residuals are mostly negative from month 11 to month 18 and mostly positive in the last six months, which means the growth is speeding up. The quadratic and exponential models both capture that curve and fit almost equally well (MSD 651 against 656). The exponential model reads as growth of about 2.6% per month.

Forecasts for the next six months:

Month252627282930
Linear765.1779.9794.8809.6824.5839.4
Quadratic789.2809.9831.0852.6874.5897.0
Exponential787.3807.9829.1850.9873.2896.1

The curved models agree within a unit by month 30, and both sit about 57 orders above the straight line. The distributor plans warehouse staffing on the exponential forecast, because steady percentage growth is easier to defend than a quadratic, and it will check the forecast every month against actual orders.

How to read the results

  • Compare the accuracy measures across models, but do not chase small differences. A gap like 651 against 656 is noise.
  • Look at the residuals over time. A run of same-signed residuals means the model shape is wrong, as with the linear fit here.
  • Read the coefficients in business terms. The linear slope is the added amount per period (14.9 orders a month); the exponential b₁ is the growth factor (2.6% a month).
  • Treat forecast differences as model risk. When reasonable models disagree by 57 orders after six months, that spread is part of the answer.

Common mistakes

  • Extrapolating far. A trend fitted to 24 months says little about month 48; a quadratic can turn sharply once it leaves the data.
  • Fitting a trend to seasonal data. A seasonal swing inflates the errors and can bias the slope if the series starts and ends in different seasons.
  • Ignoring a level shift. A new customer or a price change can create a step that a smooth curve turns into a false slope.
  • Treating the accuracy measures as forecast error. MAPE, MAD and MSD describe the fit to past data; real forecast errors are usually larger.

Frequently asked questions

Which accuracy measure should I use to choose a model?

Use MSD if large misses are costly, MAD if you want an error in the data's units, and MAPE to compare series with different scales. They usually agree; when they disagree, the models are close and other reasons should decide.

How is trend analysis different from linear regression?

It is a regression with time as the only predictor. The difference is in how you use it: the goal is a forecast, and the observations are ordered in time, so the errors are often correlated. That makes the usual regression p-values too optimistic.

What if growth levels off?

None of the three models has a ceiling. An S-curve (logistic) model rises and then levels off toward a limit, which suits adoption or saturation, such as the share of machines converted to a new tool. Over a short horizon, a quadratic with a negative b₂ can also describe slowing growth, but it will eventually turn down.

How many periods do I need?

At least a dozen for a straight line, and more for a curve. With fewer points, a curve fits noise and its forecasts swing widely.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab