MFVARResult.nowcast#
- MFVARResult.nowcast(index=-1)[source]#
The latent value of every variable at one period.
- Parameters:
index (
int) – Position in the sample; negative indexes from the end.- Return type:
- Returns:
Mapping from variable name to its inferred value.
- Raises:
DimensionError – If
indexis out of range.
Example
>>> import numpy as np >>> A, S = np.array([[[0.5, 0.1], [0.0, 0.4]]]), np.eye(2) >>> y = np.full((24, 2), np.nan) >>> rng = np.random.default_rng(0) >>> y[:, 0], y[2::3, 1] = rng.standard_normal(24), rng.standard_normal(8) >>> res = MFVAR(A, S, kinds=["high", "flow"], period=3).smooth(y) >>> current = res.nowcast() >>> sorted(current), bool(abs(current["y1"] - y[-1, 0]) < 1e-6) (['y1', 'y2'], True) >>> res.nowcast(24) Traceback (most recent call last): cultivars.exceptions.DimensionError: index 24 is out of range for 24 periods.