fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

Forecast Models

6 algorithms in Statistical Time Series · 6 with asserted arithmetic.

In this family#

  1. AutoReg verified

    Forecasts from an autoregression with supplied coefficients. Estimation is deliberately separate: this evaluates a model you already have, which keeps the arithmetic checkable.

    forecastAutoReg(values, ar, intercept, horizon)
  2. ARMA verified

    ARMA forecasting with supplied coefficients: autoregressive terms on past values, moving-average terms on past errors.

    forecastARMA(values, ar, ma, intercept, horizon)
  3. ARIMA verified

    ARMA on a differenced series, with forecasts integrated back to the original level. The integration step is where sign and level errors hide, so both the differenced and the level forecast are returned.

    forecastARIMA(values, ar, ma, intercept, differenceOrder, horizon)
  4. SARIMA/SARIMAX verified

    Seasonal ARIMA with optional exogenous regressors. Future exogenous values must be supplied for the whole horizon — if you do not know them, the forecast is conditional on a guess, and that dependency is worth being explicit about.

    forecastSARIMAX(values, exog, futureExog, beta, ar, ma, seasonalAr, seasonalMa, intercept, differenceOrder, seasonalDifferenceOrder, period, horizon)
  5. Holt-Winters verified

    Additive Holt-Winters: exponential smoothing of level, trend and seasonality. Unfashionable and frequently competitive with far more complex methods on short seasonal series.

    forecastHoltWintersAdditive(values, alpha, beta, gamma, period, horizon, initialLevel, initialTrend, initialSeasonals)
  6. Theta Forecast verified

    The Theta method: decompose, extrapolate, recombine. It won the M3 forecasting competition and is roughly equivalent to simple exponential smoothing with drift — a useful benchmark precisely because it is so simple.

    forecastTheta(values, alpha, horizon)

What they share#

Every topic here is a record-transform, so once you have called one the rest follow the same shape. Import paths differ only in the final segment:

ts
import { forecastAutoReg } from "fintech-algorithms/statistical-time-series/forecast-models/autoreg";
import { forecastARMA } from "fintech-algorithms/statistical-time-series/forecast-models/arma";

Read them in the order above — the sequence is pedagogical, not alphabetical.

Where this sits#

Statistical Time Series collects 29 algorithms across 5 families. For the concept behind this family rather than the call signatures, see the concept guides.