TVPVARSV.fit#
- TVPVARSV.fit(*, n_draws=2000, n_burn=1000, thin=2, k_drift=0.01, k_vol=0.01, seed=None)[source]#
Estimate by Gibbs sampling with the KSC volatility block.
Each iteration draws the coefficient path given the current covariance path,
Qgiven the increments, and then the volatility block – the log-variance paths through the KSC mixture with the simulation smoother, the rows ofA, and the diagonalW– given the residuals.- Parameters:
- Return type:
- Returns:
The fitted
TVPVARSVResult.- Raises:
SpecificationError – If the draw bookkeeping is inconsistent.
NumericalError – If a conditional draw collapses.
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.n_kept, res.h_draws.shape, res.impact_draws.shape (13, (13, 99, 2), (13, 2, 2)) >>> isinstance(res, TVPVARResult), type(res).__name__ (True, 'TVPVARSVResult')