EGARCH#

class cultivars.univariate.conditional_variance.EGARCH(endog, *, p=1, o=1, q=1, ar_lags=0, mean='constant')[source]

Bases: _ShortMemoryVarianceModel[GARCHResult]

EGARCH(p, o, q): the recursion runs in logs, so no positivity constraint binds.

The variance recursion

\[\log\sigma_t^2 = \omega + \sum_{i=1}^{p} \alpha_i\bigl(|z_{t-i}| - \sqrt{2/\pi}\bigr) + \sum_{k=1}^{o} \gamma_k\, z_{t-k} + \sum_{j=1}^{q} \beta_j \log\sigma_{t-j}^2, \qquad z_t = \varepsilon_t / \sigma_t,\]

driven by the standardized shock rather than the squared residual. Because the variance is exponentiated, \(\omega\), \(\alpha\) and \(\gamma\) are searched freely and may be negative; only the persistence block is bounded, \(|\sum_j \beta_j| < 0.999\), which keeps the log variance stationary. The magnitude term is centred by \(E|z| = \sqrt{2/\pi}\) so a Gaussian shock contributes no drift; the sign term is the leverage effect, with \(\gamma < 0\) meaning a negative shock raises volatility more than a positive one of the same size – the opposite sign convention from GJR. The reported parameters are on the log scale, which is why GARCHResult.unconditional_variance declines to translate them back: the stationary level is the mean of a lognormal and depends on the whole innovation distribution. The asymmetry order must be at least one.

Variables:
  • _vol – The family name, "EGARCH".

  • _p – Magnitude order.

  • _o – Sign order.

  • _q – Log-variance persistence order.

  • _endog – The validated series.

  • _ar_lags – Conditional-mean AR order.

  • _ma_lags – Conditional-mean MA order, always zero here.

  • _const – Whether the mean carries an intercept.

Parameters:
  • endog (ArrayLike) – The series, typically returns or residuals.

  • p (int) – Magnitude order.

  • o (int) – Sign (leverage) order; must be at least 1.

  • q (int) – Log-variance persistence order.

  • ar_lags (int) – Conditional-mean AR order.

  • mean (str) – "constant" or "zero".

Raises:
  • SpecificationError – If an order is not a non-negative integer, o is zero, or mean is not one of the two choices.

  • DimensionError – If endog is not one-dimensional or is shorter than the orders require.

  • NumericalError – If endog contains non-finite values.

See also

  • GARCHResult – what fit() returns; its persistence is \(\sum_j \beta_j\) for this family.

  • GJR – leverage in a level recursion, with a closed-form unconditional variance.

  • ARMAEGARCH – the same variance under an ARMA mean.

References

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

Example

A leverage effect in logs recovered with its sign:

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> n = 3000
>>> lh, e, z = np.zeros(n), np.zeros(n), rng.standard_normal(n)
>>> for t in range(1, n):
...     lh[t] = -0.1 + 0.15 * (abs(z[t - 1]) - np.sqrt(2 / np.pi))
...     lh[t] += -0.08 * z[t - 1] + 0.95 * lh[t - 1]
...     e[t] = np.exp(lh[t] / 2) * z[t]
>>> res = EGARCH(e).fit()
>>> res.vol, res.order, res.has_leverage
('EGARCH', (1, 1, 1), True)
>>> bool(res.gamma[0] < 0), bool(abs(res.beta[0] - 0.95) < 0.05)
(True, True)
>>> res.unconditional_variance is None, bool(res.half_life > 0)
(True, True)