garch_11¶
-
sim.
garch_11
(n, sigma_sq_0, mu, alpha, beta, omega)[source]¶ Generate GARCH(1, 1) log-returns of size n. This function is accelerated via JIT with Numba.
- Parameters
- nint
The length of the wished time series.
- sigma_sq_0float > 0
The variance starting value.
- mufloat:
The drift of log-returns.
- alphafloat >= 0
The volatility shock parameter. A higher value will lead to larger spikes in volatility. A.k.a short-term persistence.
- betafloat >= 0
The volatility persistence parameter. A larger value will result in stronger persistence. A.k.a long-term persistence.
- omegafloat > 0
The variance constant. A higher value results in a higher mean variance.
- Returns
- rnumpy.ndarray
The GARCH log-returns time series.
- sigma_sqnumpy.ndarray
The resulting variance time series with which each log-return was generated.
Notes
In general, the conditional variance of a GARCH(p,q) model is given by
\[\sigma_{t}^{2}=\omega+\sum_{i=1}^{q} \alpha_{i} \varepsilon_{t-i}^{2}+\sum_{j=1}^{p} \beta_{j} \sigma_{t-j}^{2}.\]The unconditional variance is given by
\[\sigma^{2}=\frac{\omega}{1-\sum_{i=1}^{q} \alpha_{i}-\sum_{j=1}^{p} \beta_{j}}.\]Here, \(p=q=1\), and \(\epsilon_{t} \sim \mathcal{N}\left(0, 1\right)\)