GibbsBVARResult._from_fit#

classmethod GibbsBVARResult._from_fit(fit, model)[source]#

Assemble the public result from a raw fit and its specification.

Parameters:
  • fit (_VectorGibbsFit) – The packed draws from _fit_gibbs.

  • model (_GibbsBayesianVectorAutoRegressionModel[GibbsBVARResult]) – The specification the draws were produced for; kept on the record so marginal_likelihood can evaluate the prior and likelihood ordinates.

Return type:

GibbsBVARResult

Returns:

The public posterior record.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> y = rng.standard_normal((120, 2))
>>> model = GibbsBVAR(y, order=1)
>>> res = GibbsBVARResult._from_fit(
...     model._fit_gibbs(n_draws=40, n_burn=10, thin=1, seed=0), model
... )
>>> res.names, res.n_kept, res.prior_label.startswith("inw")
(('y1', 'y2'), 30, True)