bvar_normal_inverse_wishart – Bayesian VAR with Normal-Inverse-Wishart prior.#

Back to family axis | Back to L4 | Browse all options

Operational op under axis family, sub-layer L4_A_model_selection, layer l4. Standalone callable: mf.functions.bvar_niw_fit.

Function signature#

mf.functions.bvar_niw_fit(
    X: np.ndarray | pd.DataFrame,
    y: np.ndarray | pd.Series,
) -> BVARNIWFitResult

Parameters#

name

type

default

constraint

description

X

`np.ndarray

pd.DataFrame`

y

`np.ndarray

pd.Series`

Returns#

BVARNIWFitResult — frozen dataclass with fit results.

Attribute

Type

Description

.n_lags

int

VAR lag order p.

.n_obs

int

Number of observations.

.predict(X)

np.ndarray

Predictions for new data X, shape (n_samples,).

.summary()

str

Table: lag order and observation count.

Behavior#

Conjugate Normal-IW prior on (β, Σ); the posterior mean of β has the same closed form as Minnesota but with the prior tightness scaled to reflect parameter-uncertainty inflation. Slightly less aggressive than the bare Minnesota prior.

When to use

Studies preferring a fully-conjugate prior over Litterman’s hand-tuned shrinkage.

In recipe context#

Set params.family = "bvar_normal_inverse_wishart" in the relevant layer to activate this op within a recipe:

# Layer L4 recipe fragment
params:
  family: bvar_normal_inverse_wishart

References#

  • macroforecast design Part 2, L4: ‘forecasting model is the layer where every authoring iteration ends – pick family, tune, repeat.’

  • Kadiyala & Karlsson (1997) ‘Numerical Methods for Estimation and Inference in Bayesian VAR-models’, Journal of Applied Econometrics 12(2).