fintech-algorithms

ARMA

Install and import

bash
npm install fintech-algorithms
ts
import { forecastARMA } from "fintech-algorithms/statistical-time-series/forecast-models/arma";

Signature

forecastARMA(values, ar, ma, intercept, horizon)

Worked example

executed Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.

Input

values
[10, 12, 11]
ar
[0.5]
ma
[0.25]
intercept
5
horizon
2

Call

forecastARMA(values, ar, ma, intercept, horizon)

Returns

object with 4 fields: forecast, fitted, residuals, state

{
  "forecast": [10.375, 10.1875],
  "fitted": [null, 10, 11.5],
  "residuals": [0, 2, -0.5],
  "state": {
    "order": [1, 1],
    "last_values": [11],
    "last_residuals": [-0.5],
    "presample_innovations": "zero",
    "future_innovations": "zero conditional mean"
  }
}

Diagrams

ARMA — boundary failure
ARMA — diagnostic workbench
ARMA — family handoff
ARMA — forecast origin
ARMA — recursion anatomy

How it works

This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.

Read the article →

References