StudentBVARResult._simulation_noise#

StudentBVARResult._simulation_noise(draw, n, rng)[source]#

Student-t innovations at one draw, or at the posterior mean when None.

At a draw this is _predictive_noise(); at the posterior mean the scale is sigma_u and the degrees of freedom are df.

Parameters:
  • draw (int | None) – Index of a kept draw, or None for the posterior mean.

  • n (int) – Innovation rows to generate.

  • rng (Generator) – Random generator.

Return type:

NDArray[double]

Returns:

An array of shape (n, k).

Example

>>> import numpy as np
>>> y = np.random.default_rng(0).standard_normal((120, 2))
>>> res = StudentBVAR(y, order=1).fit(df=5.0, n_draws=30, n_burn=10, seed=0)
>>> res._simulation_noise(None, 7, np.random.default_rng(0)).shape
(7, 2)
>>> res._simulation_noise(3, 7, np.random.default_rng(0)).shape
(7, 2)