CommencerCommencer gratuitement

Comouvement entre volatilité prédite et VaR

Les graphiques de value-at-risk montrent une forte variation temporelle du risque de baisse. Cette variation est principalement due aux fluctuations de la volatilité des rendements. Dans cet exercice, vous allez le vérifier pour les rendements quotidiens de Microsoft en traçant sur une même figure la value-at-risk à 5 % et la volatilité estimée. L’objet garchroll contenant la sortie d’une estimation GARCH roulante est déjà disponible dans la console.

Cet exercice fait partie du cours

Modèles GARCH en R

Afficher le cours

Instructions

  • Obtenez le data frame avec les prédictions de moyenne et de volatilité à partir de garchroll.
  • Utilisez la méthode appropriée pour extraire le VaR à 5 % depuis garchroll.
  • Extrayez la volatilité de garchpreds.
  • Analysez le comouvement dans un graphique de série temporelle.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Extract the dataframe with predictions from the rolling GARCH estimation
garchpreds <- ___(garchroll)

# Extract the 5% VaR 
garchVaR <- ___(garchroll, ___ = ___)

# Extract the volatility from garchpreds
garchvol <- xts(garchpreds$___, order.by = time(garchVaR))

# Analyze the comovement in a time series plot
garchplot <- plot(garchvol, ylim = c(-0.1, 0.1))
garchplot <- addSeries(garchVaR, on = 1, col = "blue")
plot(garchplot, main = "Daily vol and 5% VaR")
Modifier et exécuter le code