VECM
Install and import
npm install fintech-algorithmsimport { fitVECMFixedBeta } from "fintech-algorithms/statistical-time-series/multivariate-systems/vecm";Signature
fitVECMFixedBeta(values, beta, differenceLags, includeIntercept)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
[
[57.3488705363, 57.391383279],
[57.9060942406, 57.7180113466],
[57.8301951168, 57.7940655992]
]Showing 3 of 120 elements.
[1, -1]1Call
fitVECMFixedBeta(values, beta, differenceLags, includeIntercept)Returns
object with 17 fields: beta, alpha, gamma, intercept, sigma_u_mle, error_correction, pi, adjustment_root, …
{
"beta": [1, -1],
"alpha": [-0.03243684502, 0.406805203364],
"gamma": [
[
[0.041044635794, -0.023887057656],
[-0.069691641426, 0.155827060535]
]
],
"intercept": [0.004904479316, 0.007790140091],
"sigma_u_mle": [
[0.115776128937, 0.119483748379],
[0.119483748379, 0.19954598501]
],
"error_correction": [
0.188082894,
0.0361295176,
-0.620844851,
-0.6261144079,
-0.5222041208,
-0.7533463451
],
"pi": [
[-0.03243684502, 0.03243684502],
[0.406805203364, -0.406805203364]
],
"adjustment_root": 0.560757951616,
"error_correction_loading_root": 0.560757951616,
"half_life": null,
"exact_half_life": null,
"half_life_scope": "not-reported-short-run-gamma-present",
"effective_observations": 118,
"rank": 1
}Showing 14 of 17 fields.
Other exports
This module also exports
companionMatrix, companionSpectralRadius, fitVAR, choleskyLower, fitRecursiveSVAR, movingAverageMatrices, impulseResponses, forecastErrorVarianceDecomposition. Every module additionally exports run as an alias of its
primary function, and a meta object carrying its catalog id, domain, family,
shape and article URL.
Diagrams
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
- statsmodels vector autoregression documentation — statsmodels developers
- statsmodels VECM API documentation — statsmodels developers
- Co-integration and Error Correction: Representation, Estimation, and Testing — Robert F. Engle and Clive W. J. Granger
- New Introduction to Multiple Time Series Analysis — Helmut Lütkepohl
- Macroeconomics and Reality — Christopher A. Sims
- Statistical Analysis of Cointegration Vectors — Søren Johansen
- Publication boundary