TVPSVARResult.impact#
- TVPSVARResult.impact(t)[source]#
The posterior mean structural impact matrix at date
t.- Parameters:
t (
int) – Row of the estimation sample.- Return type:
- Returns:
A lower-triangular
(k, k)matrix.- Raises:
SpecificationError – If
tis out of range.
Example
Under stochastic volatility the impact drifts from date to date while staying lower triangular:
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> y = np.zeros((140, 2)) >>> for t in range(1, 140): ... y[t] = 0.5 * y[t - 1] + rng.standard_normal(2) >>> source = TVPVARSV(y, order=1, training=40).fit(n_draws=40, n_burn=15, seed=0) >>> svar = TVPSVAR(source).identify() >>> first, last = svar.impact(0), svar.impact(98) >>> bool(np.allclose(first, np.tril(first))), bool(np.any(first != last)) (True, True) >>> svar.impact(99) Traceback (most recent call last): cultivars.exceptions.SpecificationError: t must be in 0..98; got 99.