FAVARResult#

class cultivars.multivariate.large_dim.factor_augmented.FAVARResult(*, panel, observed, factors, loadings, scores, panel_names, explained_variance, r2, cleaned, _scales)[source]#

A fitted factor-augmented vector autoregression.

The estimates of

\[\begin{split}\begin{pmatrix} F_t \\ Y_t \end{pmatrix} = \sum_{i=1}^{p} A_i \begin{pmatrix} F_{t-i} \\ Y_{t-i} \end{pmatrix} + u_t, \qquad x_t = \Lambda^F F_t + \Lambda^Y Y_t + e_t,\end{split}\]

where \(F_t\) are the principal-component factors of the standardized panel \(x_t\) (cleaned of \(Y_t\)’s contemporaneous influence when slow series were declared), \(Y_t\) is the observed block, and the observation equation is fitted by least squares one panel series at a time. Composition, stated plainly: factors is a complete VARResult on the augmented block, and every factor-level question – coefficients, diagnostics, stability, reduced-form impulse responses – is answered there. It is also a closed system, so every identification model in cultivars.multivariate.structural accepts it directly, and FactorAugmentedSVAR maps an identified factor-space shock onto responses of every series through loadings. This object owns what the factor result cannot know: the panel, the loadings and the standardization that was undone.

Note

explained_variance is the principal components’ share before cleaning, since cleaning moves the factors off the component basis. r2 and common_component are unaffected by cleaning: the cleaned factors span, together with the observed block, the same column space as the raw ones, so the observation equation fits identically. The factor labels f1 ... fr are a basis, not names – principal components are identified up to rotation, and loadings rotate with them, so panel responses to an identified shock do not depend on the basis while a factor-by-factor reading does.

Variables:
  • panel – The informational panel as supplied.

  • observed – The observed block as supplied.

  • factors – The fitted VAR on [F, Y], carrying the whole reduced-form surface and accepting every identification model.

  • loadings – (n_series, r + m) observation-equation coefficients of the standardized panel on the augmented block.

  • scores – The (nobs, r) estimated factors, cleaned when slow was declared.

  • panel_names – One label per panel series.

  • explained_variance – Share of standardized panel variance each factor carries, before cleaning.

  • r2 – Per-series fit of the observation equation, the common-component share of each series.

  • cleaned – Whether the Bernanke-Boivin-Eliasz slow-variable cleaning ran.

See also

  • FAVAR – the model that produces this record.

  • FactorAugmentedSVAR – identification on factors mapped onto the panel.

  • DFMResult – the factor model without an observed block.

References

Bernanke, B. S., Boivin, J., & Eliasz, P. (2005). Measuring the effects of monetary policy: A factor-augmented vector autoregressive (FAVAR) approach. Quarterly Journal of Economics, 120(1), 387-422.

Example

One factor, thirty series, a policy rate that loads on the factor; the augmented VAR has two variables and the observation equation explains most of the panel:

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> factor = np.zeros(300)
>>> for t in range(1, 300):
...     factor[t] = 0.7 * factor[t - 1] + rng.standard_normal()
>>> panel = np.outer(factor, rng.uniform(0.5, 1.5, 30))
>>> panel += 0.3 * rng.standard_normal((300, 30))
>>> policy = 0.4 * factor + rng.standard_normal(300)
>>> res = FAVAR(panel, policy[:, None], n_factors=1, order=1).fit()
>>> res.n_series, res.n_factors, res.factors.names, res.cleaned
(30, 1, ('f1', 'y1'), False)
>>> res.loadings.shape, res.scores.shape, res.explained_variance.shape
((30, 2), (300, 1), (1,))
>>> bool(res.r2.mean() > 0.9), bool(abs(np.corrcoef(res.scores[:, 0], factor)[0, 1]) > 0.95)
(True, True)

Attributes#

panel

The informational panel as supplied, (nobs, n_series).

observed

The observed block as supplied, (nobs, m).

factors

The fitted VAR on [F, Y], variables ``f1 .

loadings

(n_series, r + m) observation-equation coefficients.

scores

(nobs, r) estimated factors, cleaned when slow was declared.

panel_names

One label per panel series, in column order.

explained_variance

(r,) variance share per component, before cleaning.

r2

(n_series,) observation-equation fit per series.

cleaned

Whether the Bernanke-Boivin-Eliasz slow-variable cleaning ran.

n_factors

Number of estimated factors.

n_series

Number of panel series.

Methods#

common_component()

The panel as the factors and observed block see it, in original units.

summary()

The estimation summary, renderable as text, HTML, or a dataframe.