Home / Science / Maths, statistics and computing / Statistics / Time series decomposition and ARIMATool #566

Time series analyser: STL and classical decomposition, ACF and PACF, ARIMA forecasts with intervals, Ljung-Box test

Paste a series and split it into trend, season and remainder (STL or classical), see the ACF and PACF with confidence bands, try differencing, and fit an ARIMA(p, d, q) model by exact maximum likelihood with forecasts, 80 % and 95 % intervals and a Ljung-Box check. Matches statsmodels.

Keep it one tap away for everyday use.

Bookmark Time series decomposition and ARIMA?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Paste series
  2. Decompose
  3. ACF, PACF
  4. Forecast
Nothing is uploadedWorks offline once open

Series

12 for monthly data with a yearly pattern, 4 for quarterly, 7 for daily data with a weekly pattern, 24 for hourly. Use 0 if there is no season. The values must be evenly spaced with no gaps. For a trend test (Mann–Kendall, Sen's slope) use the trend analyser.

Decomposition

Autocorrelation and differencing

A trend shows as an ACF that dies away slowly: difference once (d = 1). A season shows as spikes at the season length: try D = 1. The shaded band is the 95 % range for pure noise (Bartlett's formula for the ACF, ±1.96/√n for the PACF).

ARIMA model and forecast

This fits non-seasonal ARIMA by exact maximum likelihood. For a strong season, take it out first (fit the STL residual plus trend), or difference at the season length and check the ACF. Up to 1,000 values.

Forecasts

Download

What it does

A time series is a set of measurements in time order: monthly sales, daily visitors, hourly temperatures. This tool takes one apart and builds a forecast, in four steps you can follow on one page:

  • Decomposition splits the series into a trend (the slow change), a season (the pattern that repeats every cycle) and a remainder. Choose STL, which lets the seasonal pattern drift slowly and can be made robust to outliers, or the classical moving-average method, additive or multiplicative. It also reports the strength of the trend and of the season (0 = none, 1 = everything).
  • Autocorrelation: the ACF and PACF with their 95 % bands, after any differencing you choose, and the Ljung–Box test of whether the values are related to earlier ones at all.
  • ARIMA(p, d, q): fitted by exact maximum likelihood, with standard errors, AIC, AICc and BIC. A button tries every p and q from 0 to 3 and keeps the lowest AICc.
  • Forecasts with 80 % and 95 % intervals, a residual ACF and a Ljung–Box check of the residuals.

How to use it

  1. Paste your values (one per line) or two columns: time and value. Open a CSV or Excel file if you prefer. The values must be evenly spaced with no gaps.
  2. Set the season length: 12 for monthly data, 4 for quarterly, 7 for daily data with a weekly rhythm, or 0 for none.
  3. Read the decomposition. The seasonal window of STL is an odd number of cycles; larger keeps the season steadier.
  4. In the autocorrelation step, add differences until the ACF dies away quickly. That number is usually the d of the ARIMA model. A PACF that cuts off after lag p suggests AR(p); an ACF that cuts off after lag q suggests MA(q).
  5. Choose p, d and q, or press Find the best p and q. Check that the residual ACF stays inside the band, then read the forecast.

Worked example

The first example is eight years of made-up monthly shop sales. STL gives a strength of trend of 0.984 and of season of 0.922: both strong. The seasonal pattern peaks in June (+10.8) and is lowest in October (−19.6). After one difference the Ljung–Box test at lag 19 gives Q = 151.5 and p = 1.15 × 10⁻²², and the ACF has spikes at lags 12 and 24, because the season is still there. ARIMA(1,1,1) gives ar.L1 = 0.27482 (SE 0.1807), ma.L1 = 0.13657 and σ² = 53.982, and the first forecast, for 2025-01, is 209.36 with an 80 % interval of 199.95 to 218.78. That simple model ignores the season, so its residuals stay autocorrelated (Ljung–Box p = 0.0053): a hint to decompose first.

The third example (made-up sensor readings with no season) is close to an ARMA process. ARIMA(2,0,1) with a mean gives ar.L1 = 0.4394, ar.L2 = −0.2201, ma.L1 = 0.6448 and AICc = 433.28, and the residual Ljung–Box p-value is 0.372: nothing left to explain.

What it does not do

It fits non-seasonal ARIMA only (no SARIMA, no outside regressors) and up to 1,000 values. Classical decomposition leaves the first and last half-cycle without a trend, as it should. For a test of whether a trend is real, with Sen’s slope and change points, use the trend analyser. For uneven sampling, use the period finder.

Frequently asked questions

Additive or multiplicative? If the seasonal swings grow as the level grows, use multiplicative (or take logs first). Otherwise additive.

Why did ARIMA warn about the MA part? An MA coefficient near −1 usually means the series was differenced once too often. Try a smaller d.

Is my data sent anywhere? No. Everything is worked out in your browser.

Where the numbers come from

  • Methods: STL as in Cleveland, Cleveland, McRae and Terpenning (1990), ported line by line from their published Fortran; classical decomposition as statsmodels' seasonal_decompose; Bartlett's formula for the ACF band; Durbin–Levinson for the PACF; the Ljung–Box test; exact ARMA likelihood by the Kalman filter.
  • Checked against statsmodels 0.15.0 (seasonal_decompose, STL, acf, pacf, acorr_ljungbox, ARIMA and SARIMAX fits, log-likelihoods and forecasts) on all three example series.
  • The example series (shop sales, museum visitors, sensor readings) are made up for this tool.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Trend and anomaly analyser #138 Paste or open a time series (yearly, monthly or any steps) and test for a trend with Mann-Kendall, the Hamed-Rao autocorrelation correction or the seasonal test, get Sen's slope with its confidence interval, a Pettitt change point and anomalies from a baseline period. Light curve period finder #48 Paste times and brightness measurements, even with gaps and uneven spacing, and find the period with a Lomb-Scargle periodogram, false alarm probabilities, alias checks and a folded light curve. Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser. Proxy record stacker #508 Open several proxy records (age and value, CSV or Excel), put them on one age grid, turn them into z-scores over a window you choose, flip the ones that run the other way, and stack them (mean or median with a ±1 SD or bootstrap envelope). Compare records with correlations corrected for autocorrelation and a lag scan. Regression workbench #561 Paste a table or open a CSV or Excel file and fit a multiple linear, polynomial or logistic regression. Get coefficients with standard errors, t or z tests, p-values and confidence intervals, R², adjusted R², AIC and BIC, odds ratios, predictions with intervals, and the diagnostic plots: residuals, Q-Q, leverage and Cook's distance, with VIF. Matches statsmodels. Probability distribution explorer #563 Pick a distribution (normal, t, chi-squared, F, beta, gamma, Weibull, binomial, Poisson and 26 more), set its parameters and see the curve with the probability between two values shaded, the quantiles, mean, variance, skewness and kurtosis, and draw seeded random samples. Matches scipy.stats.