FIGARCH
Install and import#
npm install fintech-algorithmsimport { calculate } from "fintech-algorithms/volatility-and-covariance/conditional-volatility/figarch";Signature#
calculate(data)Keep retained fractional weights and omitted backcast mass separate. Supplied-parameter educational reference; no fitted performance claim.
Parameters#
| Name | Type | Notes |
|---|---|---|
data | TopicInput | See data-contract/CONTRACT.md. |
Returns#
TopicResult
Structured result with readiness, values, parameters, and diagnostics.
Warm-up#
The first depends on window or model order positions are null prefix until minimum history exists.
Errors#
- When required data is missing, non-finite, malformed, or out of range — raises ContractError / Error
Complexity: time O(nm),
space Full diagnostic trace retained for teaching; see implementation for observation/window/matrix dimensions.
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#
{
"returns": [-0.02, 0.01, 0],
"parameters": {
"omega": 0.000002,
"initial_variance": 0.0001,
"d": 0.4,
"truncation": 2,
"backcast_variance": 0.0001
}
}Call#
calculate(data)Returns#
object with 8 fields: topic_id, title, parameters, series, latest, ready, ready_at, diagnostics
{
"topic_id": "D10-F03-A05",
"title": "FIGARCH",
"parameters": {
"omega": 0.000002,
"initial_variance": 0.0001,
"d": 0.4,
"truncation": 2,
"backcast_variance": 0.0001
},
"series": [
{
"index": 0,
"variance": 0.000102,
"intercept": 0.000002,
"weights": [0.4, 0.12],
"lag_contributions": [],
"backcast_contribution": 0.0001,
"memory_mass": 0
},
{
"index": 1,
"variance": 0.000222,
"intercept": 0.000002,
"weights": [0.4, 0.12],
"lag_contributions": [0.00016],
"backcast_contribution": 0.00006,
"memory_mass": 0.4
},
{
"index": 2,
"variance": 0.000138,
"intercept": 0.000002,
"weights": [0.4, 0.12],
"lag_contributions": [0.00004, 0.000048],
"backcast_contribution": 0.000048,
"memory_mass": 0.52
}
],
"latest": {
"index": 2,
"variance": 0.000138,
"intercept": 0.000002,
"weights": [0.4, 0.12],
"lag_contributions": [0.00004, 0.000048],
"backcast_contribution": 0.000048,
"memory_mass": 0.52
},
"ready": true,
"ready_at": 0,
"diagnostics": {
"causal": true,
"input_count": 3,
"fitted_parameters": false,
"model": "figarch"
}
}Diagrams#
Calculation flow#
FIGARCH — calculation-flow
flowchart TD
N0["δ1 = d"]
N1["Recur unnormalized fractional weights"]
N2["Weight newest through oldest shocks"]
N3["Assign unused mass to backcast"]
N0 --> N1 --> N2 --> N3
FIGARCH — decision-boundary
flowchart TD
A["Supplied observations and parameters"] --> B{"Contract valid?"}
B -->|No| E["Reject with explicit error"]
B -->|Yes| C{"Required history available?"}
C -->|No| W["Withhold; never insert zero"]
C -->|Yes| D["FIGARCH calculation"]
D --> F["Inspect diagnostics and stated limits"]
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.
References#
- Scope of evidence