TVPVARSVResult#
- class cultivars.multivariate.nonlinear.time_varying.TVPVARSVResult(*, endog, names, order, trend, training, nobs, beta_mean, beta_low, beta_high, beta_draws, state_cov, sigma_u, resid, fittedvalues, n_draws, n_burn, thin, h_draws, impact_draws, vol_of_vol)[source]
Bases:
TVPVARResultA fitted TVP-VAR with stochastic volatility, after Primiceri (2005).
Everything the homoskedastic result reports, plus the volatility side: the innovation covariance drifts through the triangular factorization
\[\Sigma_t = A^{-1} H_t A^{-\top}, \qquad H_t = \mathrm{diag}\bigl(e^{h_{1,t}}, \ldots, e^{h_{k,t}}\bigr), \qquad h_t = h_{t-1} + \zeta_t, \quad \zeta_t \sim N(0, W),\]with \(A\) a constant unit-lower-triangular matrix and the log variances random walks drawn by the Kim-Shephard-Chib mixture sampler. The impact and log-variance draws are retained because the structural wrapper needs their posterior, not a point.
Note
sigma_uon this result is the posterior mean of the end-of-sample covariance \(\Sigma_T\); the full path is inh_drawsandimpact_draws. Because \(A\) is triangular in the order ofnames, the recursive identification is fixed when the model is fitted:TVPSVARrefuses a different ordering on this result.- Variables:
h_draws –
(S, nobs, k)kept log-variance path draws.impact_draws –
(S, k, k)kept draws ofA^{-1}.vol_of_vol –
(k,)posterior mean random-walk variances of the log volatilities.
See also
TVPVARSV– the model that produces this record.TVPVARResult– the homoskedastic parent.BVARSVResult– constant coefficients with the same drifting covariance.
References
Primiceri, G. E. (2005). Time varying structural vector autoregressions and monetary policy. Review of Economic Studies, 72(3), 821-852.
Del Negro, M., & Primiceri, G. E. (2015). Time varying structural vector autoregressions and monetary policy: A corrigendum. Review of Economic Studies, 82(4), 1342-1345.
Kim, S., Shephard, N., & Chib, S. (1998). Stochastic volatility: Likelihood inference and comparison with ARCH models. Review of Economic Studies, 65(3), 361-393.
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) >>> res.h_draws.shape, res.impact_draws.shape, res.vol_of_vol.shape ((13, 99, 2), (13, 2, 2), (2,)) >>> bool(np.allclose(np.diagonal(res.impact_draws, axis1=1, axis2=2), 1.0)) True >>> bool(np.allclose(res.impact_draws[0], np.tril(res.impact_draws[0]))) True >>> res.volatility_path("y1").shape, res._family() ((99, 3), 'TVP-VAR-SV')
Private methods#
|
Specification stem for display. |