StudentBVARResult._predictive_noise#

StudentBVARResult._predictive_noise(draw, steps, rng)[source]#

Student-t innovations: the predictive keeps the fat tails.

Overrides the family’s Gaussian hook. Each step draws its own mixing weight w ~ Gamma(nu/2, nu/2) and divides a Gaussian vector with the draw’s scale matrix by sqrt(w), with nu the draw’s own degrees of freedom when estimated and the stated value otherwise.

Parameters:
  • draw (int) – Index of the kept draw.

  • steps (int) – Innovation rows to generate.

  • rng (Generator) – Random generator.

Return type:

NDArray[double]

Returns:

An array of shape (steps, k).

Example

>>> import numpy as np
>>> y = np.random.default_rng(0).standard_normal((120, 2))
>>> res = StudentBVAR(y, order=1).fit(df=3.0, n_draws=30, n_burn=10, seed=0)
>>> noise = res._predictive_noise(0, 5000, np.random.default_rng(0))
>>> noise.shape
(5000, 2)
>>> scaled = noise / np.sqrt(np.diag(res.sigma_draws[0]))
>>> bool(np.mean(np.abs(scaled) > 3.0) > 0.02)
True