TVPSVAR#
- class cultivars.multivariate.nonlinear.time_varying.TVPSVAR(source, *, order=None)[source]#
Recursive structural interpretation of a fitted TVP-VAR, per date.
Not an
_IdentificationModel: a drifting system is a continuum of closed systems, one per date, and what this class packages is the path of identifications under a single recursive declaration.The declaration works differently across the two reduced forms, and the difference is enforced rather than papered over. For the homoskedastic model the ordering is applied here, to the posterior mean covariance, and any permutation of
namesis admissible. For the SV model the triangular factorization was the estimation:Aand the volatility paths were drawn in the order ofnames, so the ordering was declared when the model was fitted, and asking for a different one here is asking for a different fitted model – refit with the columns reordered.- Variables:
_source – The fitted reduced-form result.
_order – The requested recursive ordering, or
Nonefor the order ofnames.
- Parameters:
source (
TVPVARResult) – A fittedTVPVARResultorTVPVARSVResult.order (
Sequence[str] |None) – Recursive ordering for the homoskedastic model;Nonekeeps the order ofnames. Refused for an SV source.
- Raises:
SpecificationError – If the source is not a fitted TVP result, an ordering is requested for an SV source, or the ordering is not a permutation of
names.
See also
TVPSVARResult– the recordidentifyreturns.Recursive– the same declaration on a constant-coefficient system.
References
Primiceri, G. E. (2005). Time varying structural vector autoregressions and monetary policy. Review of Economic Studies, 72(3), 821-852.
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) >>> svar = TVPSVAR(res).identify() >>> svar.irf(4, t=50).shape (5, 2, 2) >>> TVPSVAR(y) Traceback (most recent call last): cultivars.exceptions.SpecificationError: TVPSVAR constructs with a fitted ... >>> TVPSVAR(res, order=("y2", "y3")) Traceback (most recent call last): cultivars.exceptions.SpecificationError: order must be a permutation of ('y1', 'y2'); ...
Methods#
|
Assemble the impact path under the recursive declaration. |