IdentificationScheme#
- class impulso.protocols.IdentificationScheme(*args, **kwargs)[source]#
Bases:
ProtocolContract for structural identification schemes.
- identify(L, var_names, posterior=None, data=None, n_lags=None)[source]#
Identify the structural shock matrix from a Cholesky factor.
- Parameters:
L (ndarray) – Lower-triangular Cholesky factor of the structural-shock covariance, shape (chains, draws, n_vars, n_vars). Produced by volatility.cholesky_at(…).
var_names (list[str]) – Endogenous variable names, in the order they appear in the underlying data.
posterior (xr.Dataset | None) – Full posterior xarray Dataset. Optional; provided by the pipeline so schemes that need additional draws (e.g., SignRestriction with restriction_horizon > 0 needs B for the MA recursion) can reach for them. Schemes that only need L may ignore this argument. Schemes that need posterior for context but receive None should raise a clear ValueError.
data (VARData | None) – The VARData used at fit time. Optional; provided by the pipeline so schemes that need the observed sample — e.g. ProxySVAR, which reconstructs reduced-form residuals and aligns an instrument by date — can reach for it. Schemes that only need L may ignore this argument.
n_lags (int | None) – Lag order of the fitted VAR. Provided alongside data because residual reconstruction needs it.
- Returns:
Structural shock matrix array of shape (chains, draws, n_vars, n_vars). Caller is responsible for wrapping into an xarray DataArray with named coords.
- Return type: