Skip to content

IdentifiedVAR

IdentifiedVAR — structural VAR with identified shocks.

IdentifiedVAR

Bases: ImpulsoBaseModel

Immutable structural VAR with identified shocks.

Attributes:

Name Type Description
idata InferenceData

InferenceData with structural_shock_matrix in posterior.

n_lags int

Lag order.

data VARData

Original VARData.

var_names list[str]

Endogenous variable names.

volatility VolatilityProcess

Volatility process carried through from the fitted VAR. Required for at= queries on impulse_response / fevd / historical_decomposition (P3), which re-call volatility.cholesky_at(at) for the requested time slice.

scheme IdentificationScheme

Identification scheme used to produce the structural shock matrix. Required for at= queries so the scheme can be re-applied to a different Cholesky factor on demand.

shock_names property

Shock coordinate labels from the structural shock matrix.

fevd(horizon=20, at=None)

Compute forecast error variance decomposition.

Parameters:

Name Type Description Default
horizon int

Number of periods.

20
at AtParam

Time index for the structural shock matrix:

  • None (default): for SV, equivalent to "last"; for Constant, ignored entirely.
  • int: query the shock matrix at this specific t.
  • "last": most recent time slice.
  • "all": return FEVDs for shocks at every t (adds a time dim to the result).
None

Returns:

Type Description
FEVDResult

FEVDResult with FEVD posterior draws.

Raises:

Type Description
ValueError

When at='all' is requested for a non-time-varying volatility process (Constant). Under constant Σ the per-t FEVD is identical for every t, so the time axis carries no information — use at=None (default) or at='last'.

historical_decomposition(start=None, end=None, cumulative=False, at=None)

Compute historical decomposition of observed series.

Historical decomposition is intrinsically time-indexed: it attributes each in-sample observation to past structural shocks. The at= parameter controls which Cholesky factor identifies those shocks.

Parameters:

Name Type Description Default
start Timestamp | None

Optional start date to restrict decomposition.

None
end Timestamp | None

Optional end date to restrict decomposition.

None
cumulative bool

If True, return cumulative shock contributions.

False
at AtParam

Time index for the structural shock matrix:

  • None (default) or "all": use cholesky_path — identify the shock at each t with its own L_t. For stochastic volatility this is the correct structural decomposition; for constant volatility L_t is the same for all t and the result matches the legacy behaviour.
  • int or "last": identify every shock with a single L queried at the supplied time index. Under stochastic volatility this is a non-standard hypothetical ("what if regime t had prevailed throughout?") and emits a UserWarning. For constant volatility the result is identical to the default.
None

Returns:

Type Description
HistoricalDecompositionResult

HistoricalDecompositionResult.

impulse_response(horizon=20, at=None)

Compute structural impulse response functions.

Parameters:

Name Type Description Default
horizon int

Number of periods.

20
at AtParam

Time index for the structural shock matrix:

  • None (default): for SV, equivalent to "last"; for Constant, ignored entirely.
  • int: query the shock matrix at this specific t.
  • "last": most recent time slice.
  • "all": return IRFs for shocks at every t (adds a time dim to the result).
None

Returns:

Type Description
IRFResult

IRFResult with IRF posterior draws.

Raises:

Type Description
ValueError

When at='all' is requested for a non-time-varying volatility process (Constant). Under constant Σ the per-t IRF is identical for every t, so the time axis carries no information — use at=None (default) or at='last'.