fintech-algorithms

Theta Forecast

Install and import

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

Signature

forecastTheta(values, alpha, 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, 14, 16]
alpha
0.5
horizon
2

Call

forecastTheta(values, alpha, horizon)

Returns

object with 3 fields: forecast, fitted, state

{
  "forecast": [16.125, 17.125],
  "fitted": [null, 10, 11, 12.5],
  "state": {
    "ses_level": 14.25,
    "ols_slope": 2,
    "alpha": 0.5,
    "finite_sample_correction": 1.875
  }
}

Diagrams

Theta Forecast — boundary failure
Theta Forecast — diagnostic workbench
Theta Forecast — family handoff
Theta Forecast — forecast origin
Theta Forecast — 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