compute_ma_phi#
- impulso.compute_ma_phi(A, horizon)[source]#
Compute MA coefficient matrices via the structural recursion.
Numpy’s @ operator broadcasts over leading dims, so the helper handles both a single rotation and a posterior tensor of draws without branching: pass each A_j with shape (n, n) for a single-draw computation, or with shape (C, D, n, n) for a batched one.
- Parameters:
- Returns:
A stacked array with the horizon axis third-to-last. For a single draw: shape (horizon + 1, n, n). For a batched posterior: shape (C, D, horizon + 1, n, n).
- Raises:
ValueError – If A is empty or horizon is negative.
- Return type: