GJR#

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

Bases: _ShortMemoryVarianceModel[GARCHResult]

GJR-GARCH(p, o, q): a level model with a sign-asymmetric ARCH term.

The variance recursion

\[\sigma_t^2 = \omega + \sum_{i=1}^{p} \alpha_i \varepsilon_{t-i}^2 + \sum_{k=1}^{o} \gamma_k\, \varepsilon_{t-k}^2\, \mathbb 1\{\varepsilon_{t-k} < 0\} + \sum_{j=1}^{q} \beta_j \sigma_{t-j}^2.\]

The asymmetry block loads only on negative shocks, so gamma > 0 is the leverage effect – bad news raising volatility more than good news of the same size. Under a symmetric innovation the indicator is on half the time, which is why the result’s persistence counts \(\gamma\) at half weight. \(\omega\), \(\alpha\) and \(\beta\) are kept positive by their transforms; \(\gamma\) is searched unconstrained, so a negative estimate is reported as the reverse asymmetry rather than clipped to zero. The asymmetry order must be at least one: a GJR with o = 0 is a GARCH, and the name should not be able to claim a leverage term it does not carry.

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

  • _p – ARCH order.

  • _o – Asymmetry order.

  • _q – GARCH 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) – ARCH order.

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

  • q (int) – GARCH 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, with has_leverage set.

  • GARCH – the symmetric special case.

  • EGARCH – asymmetry through the sign of the standardized shock in a log-variance recursion.

  • ARMAGJR – the same variance under an ARMA mean.

References

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.

Example

A leverage effect recovered, and preferred by BIC over the symmetric fit:

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> n = 3000
>>> h, e = np.ones(n), np.zeros(n)
>>> for t in range(1, n):
...     h[t] = 0.05 + 0.03 * e[t - 1] ** 2 + 0.85 * h[t - 1]
...     h[t] += 0.10 * e[t - 1] ** 2 * (e[t - 1] < 0)
...     e[t] = np.sqrt(h[t]) * rng.standard_normal()
>>> res = GJR(e).fit()
>>> res.has_leverage, list(res.params)
(True, ['const', 'omega', 'alpha[1]', 'gamma[1]', 'beta[1]'])
>>> bool(abs(res.gamma[0] - 0.10) < 0.05)
True
>>> symmetric = GARCH(e).fit()
>>> bool(res.information_criteria.bic < symmetric.information_criteria.bic)
True