TVPVARSVResult.coefficients_at#

TVPVARSVResult.coefficients_at(t)[source]#

The posterior mean lag stack A_1..A_p prevailing at date t.

Parameters:

t (int) – Row of the estimation sample, 0..nobs-1.

Return type:

NDArray[double]

Returns:

A (p, k, k) stack; [l - 1, i, j] is the posterior mean coefficient on lag l of variable j in equation i at date t.

Raises:

SpecificationError – If t is 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.