BVARSV#

class cultivars.multivariate.large_dim.volatility.BVARSV(endog, *, order, prior=None, trend='c', names=None)[source]

Bases: _VolatilityBayesianVectorAutoRegressionModel[BVARSVResult]

Bayesian VAR with stochastic volatility, Carriero-Clark-Marcellino.

Constant coefficients under a Minnesota prior – the full Litterman prior, cross-equation weight included, since no conjugacy is needed – with per-equation random-walk log volatilities through the triangular factorization. Order names in the recursive ordering you intend: the factorization makes it a structural declaration.

Parameters:
  • endog (ArrayLike) – The observed panel, shape (nobs, k).

  • order (int) – Autoregressive order.

  • prior (_Prior | None) – Any finite-variance moment prior; dummy-observation content is refused. Defaults to MinnesotaPrior().

  • trend (Literal['n', 'c', 'ct']) – Deterministic terms.

  • names (Sequence[str] | None) – One label per variable, in the intended recursive order.

Example

>>> rng = np.random.default_rng(0)
>>> y = np.zeros((150, 2))
>>> for t in range(1, 150):
...     scale = 0.5 + 1.0 * t / 150
...     y[t] = 0.5 * y[t - 1] + scale * rng.standard_normal(2)
>>> res = BVARSV(y, order=1).fit(n_draws=60, n_burn=20, seed=0)
>>> res.volatility_path("y1").shape
(149, 3)
>>> res.h_draws.shape[1:]
(149, 2)