How QuantumLayers Forecasts Time Series: STL, Holt-Winters and SARIMA

Any dataset with a date column and a numeric column is a time series, and most business questions about one come down to two things: is there a pattern, and where is it going? QuantumLayers now answers both as part of the standard insights run. It decomposes every series into trend and seasonal components, picks the columns with real structure, and forecasts them with two independent models. This guide walks through each step, shows what the decomposition and forecasts look like, and gives four habits for reading the results correctly.


What Is New

QuantumLayers has always answered the first question with its temporal analysis pipeline: stationarity, trend, structural breaks and autocorrelation. Three new methods now answer the second.

MethodWhat it doesWhat you see
STL-style seasonal decompositionSplits a series into trend, seasonal cycle and residualSeasonal and trend strength, plus when the cycle peaks and bottoms out
Holt-Winters exponential smoothingTracks level, trend and season as running estimatesA forecast with its smoothing constants and in-sample RMSE
SARIMAModels the series from its own past values and past errorsAn independent second forecast to compare against

There is nothing to configure. If your dataset has a date column and enough history, the forecasts appear among your insights. The date column can hold full dates, timestamps, months (2024-01), quarters (2024-Q1) or plain years. Plain years are recognised as dates when the column name says so (year, date, period and similar), since on their own they look like any other number.

Five steps from raw rows to a forecast What runs on every dataset with a date column, with nothing to configure Steps 1 to 3 run on every eligible column. Steps 4 and 5 run on the five columns with the most structure. STEP 1 Regularize Aggregate to hour…year STEP 2 Test ADF, CUSUM, trend, ACF STEP 3 Decompose Trend, season, residual STEP 4 Rank Keep the top five STEP 5 Forecast Holt-Winters + SARIMA all eligible columns top five columns only

Step 1: Building a Regular Series

Raw business data is rarely evenly spaced. Orders arrive at random times; some days have hundreds of rows and some have none. Forecasting models need one value per period, at a regular interval.

QuantumLayers first picks an aggregation interval: hour, day, week, month or year. It chooses the interval so that each bucket holds a few observations on average, with at least five buckets overall, and never finer than the data itself: a column of years is grouped by year and a column of months by month, however many rows share each period. It then averages each numeric column within each bucket and fills short gaps. The interval also sets the seasonal cycle to look for, and through it the forecast horizon.

IntervalSeasonal cycle checkedPeriods per cycleForecast horizon
HourlyDaily2412 periods (capped)
DailyWeekly77 days
WeeklyYearly5212 weeks (capped)
MonthlyYearly1212 months
YearlyNonen/aAbout 20% of the length, 3 to 6 periods

Step 2: The Temporal Tests

Before any forecasting, each column goes through the existing temporal tests. Their results decide which columns are worth forecasting, and one of them sets how SARIMA is differenced.

TestQuestion it answersUsed later for
Stationarity (ADF)Does the series wander without a stable mean?Differencing first, so a random walk is not mistaken for a trend; SARIMA’s d
Structural breaks (CUSUM)Did the mean shift at some point and stay shifted?Ranking bonus
Average levelIs the mean significantly different from zero?Ranking bonus
AutocorrelationHow much does each period resemble the one before?Ranking score
TrendIs there a linear trend, and how well does it fit?Ranking score (R²)

Step 3: Seasonal Decomposition

Every column with at least 12 aggregated periods, and enough history for about two full seasonal cycles, gets a seasonal decomposition. The method follows the classical STL approach:

  1. Estimate a rough trend with a centered moving average over one full cycle.
  2. Subtract it and average what remains at each position in the cycle (every Monday, every January) to get the seasonal pattern.
  3. Remove that pattern, re-estimate the trend on the deseasonalized series, and extract the seasonal pattern again against the refined trend.
  4. Whatever is left is the residual.
One series, three components STL decomposition of four years of monthly data Simulated data. Seasonal strength 0.93, trend strength 0.98: both well above the 0.3 reporting threshold for seasonality. Observed Trend Seasonal Residual Year 1 Year 2 Year 3 Year 4

From these components, QuantumLayers computes two measures defined by Hyndman and Athanasopoulos in Forecasting: Principles and Practice. Seasonal strength, from 0 to 1, is how much of the non-trend variation the seasonal cycle explains. Trend strength, from 0 to 1, is how much of the non-seasonal variation the trend explains. In the example, the residual panel is small next to the other two, so both strengths are close to 1.

When seasonal strength is above 0.3, the insight reports it along with where the cycle peaks and bottoms out, in calendar terms. For example: “peaking around Friday and lowest around Monday”, or “peaking around the week of Jun 7 and lowest around the week of Dec 20”.

Step 4: Choosing Which Columns to Forecast

Fitting forecasting models is more expensive than running the other tests, and a forecast of a flat, structureless column tells you nothing. So QuantumLayers ranks the columns and forecasts only the top five. Each column’s score adds up the evidence of real temporal structure.

Score componentRewards
Trend fit (R²)A clear linear direction
Autocorrelation strengthMemory from one period to the next
Seasonal strengthA repeating cycle
Structural break bonusA detected shift in the mean
Significant level bonusA mean clearly different from zero

A column does not have to pass any single test to be forecast. The score only decides the order. In a dataset with ten numeric columns, the five with the most going on get forecasts, and the rest do not.

Step 5: The Forecasting Models

Forecasts look one seasonal cycle ahead, capped at 12 periods, as in the table in Step 1. Short horizons are deliberate: forecast error grows quickly with distance.

Holt-Winters

Holt-Winters exponential smoothing keeps three running estimates: the current level, the current trend, and the seasonal effect at each position in the cycle. At every step, each estimate is updated as a weighted blend of the new observation and the previous estimate. Three smoothing constants control the weights: alpha for the level, beta for the trend and gamma for the season.

QuantumLayers searches a grid of values (0.1, 0.3, 0.5, 0.7, 0.9) for each constant and keeps the combination with the lowest in-sample squared error. Low values mean the model trusts long history; high values mean it reacts quickly to recent data. If there are at least two full seasonal cycles of history, the model runs with all three components (triple exponential smoothing). Otherwise it drops the seasonal part and runs Holt’s linear method (double exponential smoothing).

SARIMA

SARIMA models a series as a combination of its own recent values (autoregressive terms), recent forecast errors (moving-average terms), and the same at seasonal lags, after differencing to remove trend and seasonality. The order is written as (p,d,q)(P,D,Q)[s]. QuantumLayers uses a fixed structure rather than an automatic order search: d is set by the ADF test (1 if the series is non-stationary, 0 otherwise), D is 1 when there is enough history to spare a full season, p = 2, q = 1, and P = Q = 1 when seasonal.

The model is estimated with the Hannan-Rissanen method. First, a long autoregression is fitted to estimate the past forecast errors. Then the series is regressed on its own lags and on those estimated errors with ordinary least squares. This avoids the numerical instability of full maximum-likelihood fitting while producing forecasts close to the textbook version. The forecasts are then integrated back to the original scale.

Holt-WintersSARIMA
Minimum historySeasonal version needs two full cycles; otherwise Holt’s linear methodAt least 20 periods, or three full cycles when seasonal
Parametersalpha, beta, gamma from a grid searchFixed (2,d,1)(1,D,1)[s]
FittingLowest in-sample squared errorHannan-Rissanen, two-stage least squares
Shown whenRMSE below the series’ standard deviation and projected change above 5%Projected change above 5%

Why Two Models

Holt-Winters and SARIMA come from different modelling traditions. Holt-Winters assumes the series is a smooth level with a trend and a repeating season. SARIMA assumes it is driven by the correlation structure of its own past. When both point the same way by similar amounts, you can have more confidence in the direction. When they disagree, that disagreement is itself information: the future is less predictable than either number suggests.

Two models, one horizon Holt-Winters and SARIMA(2,0,1)(1,1,1)[12] forecasts, 12 months ahead Simulated data. Shaded band: forecast ± Holt-Winters in-sample RMSE (3.0). Out-of-sample error is usually larger. 160 200 240 280 320 forecast horizon Year 1 Year 2 Year 3 Year 4 Year 5 Holt-Winters +6% SARIMA +6% History

On the simulated series above, a clean trend with a regular cycle, the two models end within a few units of each other, and the Holt-Winters in-sample RMSE of 3.0 is a small fraction of the series’ standard deviation of 23. Real data is rarely this tidy. On ten years of NASA POWER clear-sky solar irradiance, the two models’ 12-week forecasts ended within 1% of each other. On ten years of Berlin weather, they agreed on the direction of the spring warm-up but differed by almost 6°C on how fast it would arrive.

Reading the Output

FieldExample
Model and parameters“triple exponential smoothing”, “SARIMA(2,0,1)(1,1,1)[52]”
Projected changePercentage from the last observed value to the last forecast value
Forecast valuesEvery period in the horizon, in the insight metadata
Holt-Winters fitChosen smoothing constants and in-sample RMSE
Suggested chartA time series chart aggregated at the same interval

Four habits will help you read them well.

Read levels when values are near zero

The headline percentage compares the last value with the final forecast value. When the last value is close to zero, the percentage becomes enormous and can be misleading. For anything that can approach or cross zero, such as temperature, profit, net flows or growth rates, look at the forecast levels instead.

Same change, very different headline A +6°C forecast reported as a percentage of the last value When values approach or cross zero, read the forecast levels instead of the percentage. 1°C → 7°C +600% 10°C → 16°C +60% 20°C → 26°C +30%

Use the RMSE as your error bar

The Holt-Winters RMSE is the typical size of the model’s error on the history it was fitted to. Out-of-sample error is usually larger. If the RMSE is 3 units, do not plan around a forecast as if it were accurate to 0.1.

Check the history length

With less than two full cycles of history, Holt-Winters cannot model seasonality and will extend the recent trend instead. If that recent trend is a seasonal decline, it will forecast the decline continuing, sometimes past physically possible values. When a forecast looks wrong, the first thing to check is whether the dataset covers enough cycles. Pulling more history usually fixes it.

Look at breaks and seasonality together

If a structural break was found, the forecast is fitted on data that includes both regimes. If you know the break reflects a permanent change, such as a price change, a new market or a new measurement method, filter the data to the period after it and run insights again.

Related: Leading Indicators

The same insights run also includes a cross-correlation test between pairs of time series. It looks for one series that moves before another, at lags of one period or more, and reports the lag: for example, “marketing spend leads signups by 2 weeks”. A leading indicator is often more useful than a statistical forecast, because it tells you what will happen based on something you can already observe. Keep in mind that two series following the same seasonal cycle will often show a one-period lead simply because each period resembles the next.

Where to Find It

Forecasts, seasonal patterns and leading indicators appear in the Insights panel of any dataset with a date column. They are also available to the QL agent, and through the generate_insights tool on the QuantumLayers MCP server, which returns forecasts as insights of type forecast. You can include them in scheduled reports, and monitors will notify you when a forecast or seasonal pattern appears or disappears between runs.

To try it without your own data, connect one of the built-in public API templates with a long history, such as Open-Meteo historical weather, NASA POWER, or FRED, and run insights.

Before trusting a forecastCheck
HistoryAt least two full seasonal cycles, three for seasonal SARIMA
FitHolt-Winters RMSE well below the series’ standard deviation
AgreementHolt-Winters and SARIMA point the same way by similar amounts
BreaksNo structural break mixing two regimes, or data filtered to after it
ScaleLevels read directly when values are near zero

For every other test in the insights run, see Inside the QuantumLayers Statistical Pipeline. For a broader introduction to forecasting with business data, see Predictive Analytics for Non-Data-Scientists. The seasonal and trend strength measures follow Hyndman, R.J. and Athanasopoulos, G., Forecasting: Principles and Practice.