GARCHResult#

class cultivars.univariate.conditional_variance.GARCHResult(*, endog, fittedvalues, resid, llf, nobs, n_params, mean, const, omega, conditional_variance, vol, ar_params, alpha, gamma, beta)[source]#

A fitted finite-order conditional-variance model.

One record for the three geometric-decay families, whose variance recursions on the mean residual \(\varepsilon_t = \sigma_t z_t\) are

\[ \begin{align}\begin{aligned}\text{GARCH:}\quad \sigma_t^2 = \omega + \sum_{i=1}^{p} \alpha_i \varepsilon_{t-i}^2 + \sum_{j=1}^{q} \beta_j \sigma_{t-j}^2,\\\text{GJR:}\quad \sigma_t^2 = \omega + \sum_{i} \alpha_i \varepsilon_{t-i}^2 + \sum_{k=1}^{o} \gamma_k \varepsilon_{t-k}^2\,\mathbb 1\{\varepsilon_{t-k} < 0\} + \sum_{j} \beta_j \sigma_{t-j}^2,\\\text{EGARCH:}\quad \log\sigma_t^2 = \omega + \sum_{i} \alpha_i\bigl(|z_{t-i}| - E|z|\bigr) + \sum_{k} \gamma_k z_{t-k} + \sum_{j} \beta_j \log\sigma_{t-j}^2,\end{aligned}\end{align} \]

with the conditional mean a constant, zero, or a short autoregression fitted jointly. The record carries the coefficient blocks and the fitted variance path; everything derived – persistence, the unconditional variance, the half-life, the standardized residuals – is computed from them by the family’s own rule, because the same coefficients mean different things across the three. vol is what makes that dispatch possible.

Variables:
  • vol (str) – The family that produced the fit, needed because persistence and the unconditional variance are different functionals across the three.

  • ar_params (NDArray[double]) – Conditional-mean AR coefficients; empty when ar_lags == 0.

  • alpha (NDArray[double]) – Coefficients on the shock magnitude.

  • gamma (NDArray[double]) – Asymmetry coefficients; empty for the symmetric family.

  • beta (NDArray[double]) – Persistence coefficients.

Note

The inherited fields are endog, fittedvalues and resid (the mean side), llf, nobs, n_params, mean, const, omega and conditional_variance; the inherited properties conditional_volatility, standardized_resid, is_covariance_stationary (persistence < 1) and half_life (\(\log 0.5 / \log \text{persistence}\)) read them. Stationarity here is variance stationarity; the conditional-mean autoregression plays no part in it, and this record carries no mean-stationarity mixin. Standard errors are not yet reported by this estimator.

See also

  • GARCH, GJR, EGARCH – the specifications that produce this.

  • ARMAGARCHResult – the same with a full ARMA mean and the mean-stationarity verdicts.

  • FIGARCHResult – the hyperbolic-decay family, whose persistence is not a single number.

References

Bollerslev, T. (1986). Generalized autoregressive conditional heteroskedasticity. Journal of Econometrics, 31(3), 307-327.

Glosten, L. R., Jagannathan, R., & Runkle, D. E. (1993). On the relation between the expected value and the volatility of the nominal excess return on stocks. Journal of Finance, 48(5), 1779-1801.

Nelson, D. B. (1991). Conditional heteroskedasticity in asset returns: A new approach. Econometrica, 59(2), 347-370.

Example

A GARCH(1, 1) with \(\omega = 0.05\), \(\alpha = 0.1\), \(\beta = 0.85\) and unconditional variance 1:

>>> rng = np.random.default_rng(0)
>>> n = 3000
>>> h, y = np.ones(n), np.zeros(n)
>>> for t in range(1, n):
...     h[t] = 0.05 + 0.1 * y[t - 1] ** 2 + 0.85 * h[t - 1]
...     y[t] = np.sqrt(h[t]) * rng.standard_normal()
>>> res = GARCH(y, p=1, q=1).fit()
>>> res.vol, res.order, list(res.params)
('GARCH', (1, 0, 1), ['const', 'omega', 'alpha[1]', 'beta[1]'])
>>> bool(abs(res.persistence - 0.95) < 0.03)
True
>>> bool(abs(res.unconditional_variance - 1.0) < 0.1)
True
>>> bool(np.allclose(res.standardized_resid, res.resid / np.sqrt(res.conditional_variance)))
True

The log-variance family withholds the unconditional variance:

>>> EGARCH(y, p=1, o=1, q=1).fit().unconditional_variance is None
True

Attributes#

vol

"GARCH", "GJR" or "EGARCH".

ar_params

(ar_lags,) conditional-mean AR coefficients.

alpha

(p,) coefficients on the shock magnitude.

gamma

(o,) asymmetry coefficients; empty for GARCH.

beta

(q,) persistence coefficients.

conditional_variance

The fitted variance path.

conditional_volatility

Conditional standard deviation, sqrt(conditional_variance).

const

Mean intercept, or None when the mean is zero.

endog

The full observed series.

fittedvalues

Fitted conditional means over the effective sample.

half_life

Periods for a variance shock to decay by half.

has_leverage

Whether an asymmetry block was estimated.

information_criteria

AIC, BIC, and HQIC derived from the likelihood and parameter count.

is_covariance_stationary

Whether the variance process has a finite unconditional level.

llf

Maximized joint Gaussian log-likelihood.

mean

"constant" or "zero".

n_params

Free parameter count.

nobs

Effective observations.

omega

Variance intercept.

order

The variance order (p, o, q) recovered from the coefficient blocks.

params

Estimated parameters keyed by display name, in table order.

persistence

The decay rate of a shock to the conditional variance.

resid

Mean residuals over the effective sample.

standardized_resid

Mean residuals scaled by the fitted conditional volatility.

unconditional_variance

The long-run variance omega / (1 - persistence).

Methods#

compare(*others[, criterion])

Rank this result against others by an information criterion.

likelihood_ratio_test(unrestricted)

Test this result as the restricted model against a nesting one.

simulate([n, seed, burn])

A fresh sample path at the fitted parameters.

summary()

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

to_dict()

The aligned per-observation outputs as plain numpy arrays.

to_pandas(*[, index])

The aligned per-observation outputs as a pandas.DataFrame.

to_polars()

The aligned per-observation outputs as a polars.DataFrame.