StudentBVAR#

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

Bases: _StudentBayesianVectorAutoRegressionModel[StudentBVARResult]

Bayesian VAR with Student-t innovations, after Chiu, Mumtaz and Pinter.

The same conjugacy-compatible prior surface as BVAR – Minnesota moments, Normal-inverse-Wishart, dummy observations and their compositions – with the Gaussian likelihood replaced by the t through its scale mixture of normals. Each date carries a latent precision weight \(w_t \sim \mathrm{Gamma}(\nu/2, \nu/2)\); conditional on the weights the model is exactly the conjugate VAR on rows rescaled by \(\sqrt{w_t}\), so the weighted update is still Normal-inverse- Wishart and the prior machinery is inherited unchanged. Dummy rows enter unweighted: they are prior content, and the tails belong to the data. The tail index \(\nu\) is either stated above two or given a posterior of its own, drawn exactly on a fixed grid.

Variables:
  • _endog – The observed panel, from the base model.

  • _order – The autoregressive order p, from the base model.

  • _trend – The deterministic specification, from the base model.

  • _names – The variable labels, from the base model.

  • _prior – The composed prior, from the base model.

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

  • order (int) – Autoregressive order.

  • prior (_Prior | None) – A conjugacy-compatible prior, possibly a composition. Defaults to NormalInverseWishartPrior().

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

  • names (Sequence[str] | None) – One label per variable. Defaults to y1 ... yk.

Raises:

SpecificationError – If the panel, order, trend or names are malformed, or the prior is not conjugacy-compatible.

See also

References

Chiu, C.-W. J., Mumtaz, H., & Pinter, G. (2017). Forecasting with VAR models: Fat tails and stochastic volatility. International Journal of Forecasting, 33(4), 1124-1143.

Geweke, J. (1993). Bayesian treatment of the independent Student-t linear model. Journal of Applied Econometrics, 8(S1), S19-S40.

Example

Innovations drawn as a \(t_4\) scale mixture; the sampler recovers single-digit degrees of freedom, and the Gaussian conjugate fit on the same data inflates its covariance to cover the tail dates while the t fit’s scale sits below it:

>>> import numpy as np
>>> from cultivars.multivariate.large_dim.bayesian import BVAR
>>> rng = np.random.default_rng(0)
>>> y = np.zeros((200, 2))
>>> for t in range(1, 200):
...     w = rng.gamma(2.0, 0.5)
...     y[t] = 0.5 * y[t - 1] + rng.standard_normal(2) / np.sqrt(w)
>>> res = StudentBVAR(y, order=1).fit(n_draws=400, n_burn=200, seed=0)
>>> res.beta_draws.shape[1:], res.weight_mean.shape
((3, 2), (199,))
>>> bool(3.0 < res.df < 10.0)
True
>>> gaussian = BVAR(y, order=1).fit(n_draws=100, seed=0)
>>> bool(np.all(np.diag(res.sigma_u) < np.diag(gaussian.sigma_u)))
True