TVPVARSVResult.volatility_path#

TVPVARSVResult.volatility_path(name)[source]#

One equation’s posterior innovation standard deviation path.

The standard deviation of the orthogonalized innovation exp(h_t / 2) – the object the model actually drifts; the reduced-form variances mix these through A^{-1}.

Parameters:

name (str) – An endogenous variable.

Return type:

NDArray[double]

Returns:

An (nobs, 3) array with columns (low, mean, high).

Raises:

SpecificationError – If the variable is unknown.

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 = TVPVARSV(y, order=1, training=40).fit(n_draws=40, n_burn=15, seed=0)
>>> path = res.volatility_path("y1")
>>> path.shape, bool(np.all(path > 0.0))
((99, 3), True)
>>> bool(np.all(path[:, 0] <= path[:, 1])), bool(np.all(path[:, 1] <= path[:, 2]))
(True, True)
>>> bool(np.allclose(path[:, 1], np.exp(0.5 * res.h_draws[:, :, 0]).mean(axis=0)))
True
>>> res.volatility_path("y3")
Traceback (most recent call last):
cultivars.exceptions.SpecificationError: unknown variable 'y3'; expected one of ...