MFVAR.smooth#

MFVAR.smooth(endog)[source]#

Infer the latent high-frequency path from the whole sample.

Parameters:

endog (ArrayLike) – The (nobs, k) sample at the high frequency, nan wherever a variable is not observed.

Return type:

MFVARResult

Returns:

The inferred path and its uncertainty, carrying the full propagation surface: because the smoothed path is complete, the forecast, the impulse responses, and the decompositions read it exactly as a VAR result reads its data.

Raises:
  • SpecificationError – If a variable has no observations at all, from the sample validation.

  • DimensionError – If the sample has no rows beyond the autoregressive order, leaving no innovation to compute.

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, intercept=[0.1, 0.0]).smooth(y)
>>> res.endog.shape, res.resid.shape, res.trend, res.deterministic
((24, 2), (23, 2), 'c', array([[0.1, 0. ]]))
>>> bool(np.allclose(res.endog[:, 0], y[:, 0]))
True