TVPVARResult.coefficients_at#
- TVPVARResult.coefficients_at(t)[source]#
The posterior mean lag stack
A_1..A_pprevailing at datet.- Parameters:
t (
int) – Row of the estimation sample,0..nobs-1.- Return type:
- Returns:
A
(p, k, k)stack;[l - 1, i, j]is the posterior mean coefficient on laglof variablejin equationiat datet.- Raises:
SpecificationError – If
tis out of range.
Example
>>> 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) >>> res = TVPVAR(y, order=1, training=40).fit(n_draws=40, n_burn=15, seed=0) >>> stack = res.coefficients_at(10) >>> stack.shape (1, 2, 2) >>> bool(np.isclose(stack[0, 1, 0], res.coefficient_path("y2", "y1.L1")[10, 1])) True >>> res.coefficients_at(res.nobs) Traceback (most recent call last): cultivars.exceptions.SpecificationError: t must be in 0..98; got 99.