SpectralDensityResult._summary_table#

SpectralDensityResult._summary_table()[source]#

Build the structured summary: peak frequency and power share per variable.

For each variable, the grid frequency of its spectral peak (excluding frequency zero), that frequency as a period, and its share of the system’s total power, \(\int f_{ii} / \int \operatorname{tr} f\); the notes restate that the density is the model’s, give the normalization, and say why zero is excluded from the peak search.

Return type:

SummaryTable

Returns:

The SummaryTable that summary(), str(), and the notebook renderer display.

Example

>>> import numpy as np
>>> from cultivars.multivariate.reduced_form.vector_autoregression import VAR
>>> rng = np.random.default_rng(0)
>>> y = np.zeros((500, 2))
>>> for t in range(1, 500):
...     y[t, 0] = 0.5 * y[t - 1, 0] + 0.4 * y[t - 1, 1] + rng.standard_normal()
...     y[t, 1] = 0.5 * y[t - 1, 1] + rng.standard_normal()
>>> res = VAR(y, order=1, names=("gdp", "rate")).fit()
>>> table = SpectralDensity(res, n_frequencies=64).compute()._summary_table()
>>> table.columns
('variable', 'peak frequency', 'peak period', 'power share')
>>> table.rows[0]
('gdp', '0.0499', '126.0', '59.5%')