Processed online by Toolvito
Time Series Analyzer
Paste a series of values (one per line, or a table with dates) to smooth it with a moving average or exponential smoothing and forecast the next values, split it into trend, seasonal and random parts, test it for autocorrelation and randomness, or fit a trend line.
How to use it
- Choose a task: Moving average or smoothing, Decomposition, Autocorrelation or Trend line.
- Paste the values, one per line (or a table with a date or period column and a value column), or choose a CSV file. Values are used in row order; empty cells are not allowed, because gaps change every result.
- Set the window, the smoothing constants or the season length, and how many periods to forecast. Select Analyze.
- Read the forecasts, the error measures and the checks; download the table (CSV), the report and the graph.
Moving averages and smoothing
- Simple moving average: the mean of the last k values; it is also the forecast for the next period (such as a 3-month moving average forecast or a 50-day moving average of prices).
- Centred moving average: centred on each value; an even window uses the 2 × k average, as in decomposition. Weighted moving average: weights such as 1, 2, 3 (oldest first) divided by their sum.
- Exponential moving average and simple exponential smoothing: Lₜ = α·yₜ + (1 − α)·Lₜ₋₁. Holt’s method (double or trend-adjusted exponential smoothing) adds a trend term with β; Holt–Winters adds seasons with γ.
- The error measures compare each one-step forecast with the value that came next: MAD (mean absolute deviation), MSE, RMSE, MAPE and the bias.
Decomposition, autocorrelation and trends
- Classical decomposition: the trend is the centred moving average over one season; the seasonal indices are the averages of (value − trend), or of (value ÷ trend) for the multiplicative model, scaled to add up to 0 or to average 1; the rest is the residual. STL lets the seasonal part change slowly.
- Autocorrelation rₖ at each lag with the bounds ±1.96/√n, the partial autocorrelation, the Ljung–Box test and the runs test for randomness. The lag-1 sums are written out, to show how it is calculated by hand.
- Trend line: a straight line y = a + b·t by least squares (also quadratic or exponential), over the period number or the dates, with forecasts and 95 % prediction intervals.
How the answers are checked
Moving averages are compared with pandas’ rolling mean, weighted averages with NumPy’s convolve, exponential averages with pandas’ ewm, and Holt and Holt–Winters with statsmodels’ ExponentialSmoothing given the same parameters and starting values. Decompositions are compared with statsmodels’ seasonal_decompose and put back together; autocorrelations with statsmodels’ acf, pacf and acorr_ljungbox; trend lines with the textbook sums in exact fractions.