GARCH and EGARCH by maximum likelihood, why the ARMA shortcut splits persistence wrongly, and a constant-correlation model for two Swedish stocks through 2008.
The second MASM18 lab is about volatility. Daily stock returns are close to uncorrelated, but their size is not: a turbulent day tends to be followed by another. Models in the GARCH family capture that by letting the variance itself evolve, and the lab fits three of them by maximum likelihood.
In GARCH(1,1), tomorrow's variance is a constant, plus a share $\alpha$ of today's squared shock, plus a share $\beta$ of today's variance:
$$\sigma_t^2 = \omega + \alpha\varepsilon_{t-1}^2 + \beta\sigma_{t-1}^2.$$
The sum $\alpha + \beta$ is the persistence, how slowly a burst of volatility dies away. Fitted to 500 simulated observations with true values $(\omega, \alpha, \beta) = (0.1,\ 0.25,\ 0.6)$, maximum likelihood gives $(0.080,\ 0.229,\ 0.659)$, and every 95 percent interval covers the truth. Optimising over the logarithms of the three keeps them positive with no constraints. The intervals are still wide and lopsided: 500 observations say a lot about the level of returns and much less about how their variance moves.
There is a cheaper route. Writing $\nu_t = X_t^2 - \sigma_t^2$ and substituting turns the GARCH recursion into
$$X_t^2 - (\alpha + \beta)X_{t-1}^2 = \omega + \nu_t - \beta\nu_{t-1},$$
an ARMA(1,1) in the squared series, which any time series package can fit. On the same data it recovers the persistence about as well, 0.863 against 0.888, but splits it worse between the two parameters, putting $\alpha$ at 0.179.
The reason is $\nu_t = \sigma_t^2(z_t^2 - 1)$. It is uncorrelated, which is all the ARMA representation needs, but it is neither independent nor normal: its variance moves with $\sigma_t^2$ and its distribution is badly skewed. The ARMA residuals fail tests for normality and for constant variance outright, with skewness 2.99 and kurtosis 16.1. So the ARMA fit is inefficient and its standard errors cannot be trusted. It happens to land closer on $\omega$ in this sample, which on one data set proves nothing. Maximum likelihood uses the right conditional density, and is the better method.
EGARCH models the logarithm of the variance instead,
$$\log\sigma_t^2 = \omega + \beta\log\sigma_{t-1}^2 + \alpha\big(|\varepsilon_{t-1}| - c\,\varepsilon_{t-1}\big),$$
so the variance is positive whatever the parameters, and none of them need constraining. With $c = 0$, as here, a rise and a fall of the same size move volatility equally. A positive $c$ is what would let a fall raise it more.
Fitted to 500 simulated observations, it recovers $\hat\alpha = 0.238$ and $\hat\beta = 0.600$ against true values of 0.25 and 0.6. The interval for $\omega$ includes zero, which is no problem: $\omega$ is a constant in the equation for $\log\sigma_t^2$, not a variance.
The extra part of the lab turns to market data: daily log returns on the AstraZeneca B and Tele2 B shares, October 2005 to October 2010, 1256 trading days. The model is the constant conditional correlation GARCH. Each stock has its own GARCH(1,1) volatility, and the standardised shocks of the two share a single fixed correlation $\rho$.
It is estimated two ways. The two-step estimate fits each stock alone, then takes the correlation of the standardised returns. The joint estimate maximises the bivariate likelihood over all nine parameters, with $\rho$ optimised as $\operatorname{atanh}\rho$ so that it stays strictly between −1 and 1.
Before trusting the joint estimator on market data, it was tested on data simulated with known parameters, twenty data sets at each of three sample sizes.
| Parameter | $n = 500$ | $n = 2000$ | $n = 8000$ |
|---|---|---|---|
| $\rho$ | 0.041 | 0.021 | 0.009 |
| $\omega$, AstraZeneca | 0.197 | 0.021 | 0.012 |
| $\beta$, AstraZeneca | 0.080 | 0.016 | 0.009 |
| $\omega$, Tele2 | 0.818 | 0.049 | 0.026 |
| $\beta$, Tele2 | 0.193 | 0.016 | 0.008 |
The table gives the standard deviation of each estimate across the twenty fits. Each step quadruples $n$, and the spread roughly halves, which is the $1/\sqrt{n}$ rate a consistent maximum likelihood estimator should show. At $n = 500$, $\omega$ and $\beta$ are barely pinned down: with $\alpha + \beta$ close to 1, the likelihood is nearly flat in those directions.
On the real data both stocks have a small $\alpha$, 0.067 and 0.084, and a $\beta$ near 0.9, so persistence is close to 1. A volatility shock takes about 25 trading days to halve for AstraZeneca and 21 for Tele2. The correlation is $\hat\rho = 0.205$, with interval $(0.151,\ 0.258)$: positive, but weak.
The two-step and joint estimates almost coincide, as they should, because in this model $\rho$ never enters the volatility recursions. The weak point is the model's own assumption: one correlation held fixed across five years that include 2008. Dynamic conditional correlation models, which let it vary, are the natural next step.
Likelihoods for GARCH, EGARCH and the bivariate model written out and maximised
with SciPy, standard errors from numerical Hessians, and a simulation study to
check the estimator before it was used on market data. The ARMA route used
statsmodels in place of MATLAB's armax.
Back to all engineering work, or the lecture notes.