IniziaInizia gratis

Simulate ARCH and GARCH series

In this exercise, you will simulate an ARCH(1) and GARCH(1,1) time series respectively using a predefined function simulate_GARCH(n, omega, alpha, beta = 0).

Recall the difference between an ARCH(1) and a GARCH(1,1) model is: besides an autoregressive component of \(\alpha\) multiplying lag-1 residual squared, a GARCH model includes a moving average component of \(\beta\) multiplying lag-1 variance.

The predefined function will simulate an ARCH/GARCH series based on n (number of simulations), omega, alpha, and beta (0 by default) you specify. It will return simulated residuals and variances. Afterwards you will plot and observe the simulated variances from the ARCH and GARCH process.

Questo esercizio fa parte del corso

GARCH Models in Python

Visualizza il corso

Istruzioni dell'esercizio

  • Simulate an ARCH(1) process with omega = 0.1, alpha = 0.7.
  • Simulate a GARCH(1,1) process with omega = 0.1, alpha = 0.7, and beta = 0.1.
  • Plot the simulated ARCH variances and GARCH variances respectively.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Simulate a ARCH(1) series
arch_resid, arch_variance = simulate_GARCH(n= 200, 
                                           omega = ____, alpha = ____)
# Simulate a GARCH(1,1) series
garch_resid, garch_variance = simulate_GARCH(n= 200, 
                                             omega = ____, alpha = ____, 
                                             beta = ____)
# Plot the ARCH variance
plt.plot(____, color = 'red', label = 'ARCH Variance')
# Plot the GARCH variance
plt.plot(____, color = 'orange', label = 'GARCH Variance')
plt.legend()
plt.show()
Modifica ed esegui il codice