StudentBVARResult.df_interval#

StudentBVARResult.df_interval()[source]#

The tail index’s posterior summary: 16th percentile, mean, 84th.

The quantiles are of the kept grid draws, so they are grid points; the mean is df.

Return type:

NDArray[double]

Returns:

A (3,) array (low, mean, high).

Raises:

SpecificationError – If the degrees of freedom were stated rather than estimated.

Example

>>> import numpy as np
>>> 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)
>>> low, mean, high = res.df_interval()
>>> bool(low < mean < high), bool(mean == res.df), bool(high < 15.0)
(True, True, True)
>>> fixed = StudentBVAR(y, order=1).fit(df=5.0, n_draws=30, n_burn=10, seed=0)
>>> fixed.df_interval()
Traceback (most recent call last):
cultivars.exceptions.SpecificationError: df was fixed at 5.0 by the caller and has ...