A GARCH(1,1) model has returns rt with conditional variance σt2 satisfying:
rt=σt⋅zt,zt∼iidN(0,1),σt2=ω+αrt−12+βσt−12.
Parameters: θ=(ω,α,β) with ω>0,α,β≥0,α+β<1 (stationarity).
Write down the log-likelihood for T observations:
ℓ(ω,α,β)=−21∑t=1T[log(2πσt2)+rt2/σt2],
where σt2 is computed recursively from σ12=ω/(1−α−β) (unconditional variance) and the observed returns.
Simulate T=2000 daily returns from GARCH(1,1) with true parameters ω0=0.00001,α0=0.1,β0=0.85. Report the unconditional volatility ω0/(1−α0−β0).
Maximise ℓ numerically (e.g. with scipy.optimize.minimize on −ℓ). Compare θ^ to the truth. (Use bounds: ω>0,α≥0,β≥0,α+β<0.9999.)
Plot the estimated conditional volatility σ^t against the true σt. Observe how GARCH tracks bursts of volatility clustering.
Hint
For the initial guess of (ω,α,β): start with (0.00001,0.1,0.8) or compute moment-matched starting values. Use L-BFGS-B with bounds, and pass options={'ftol': 1e-10} for tight convergence.