Modele GARCH în R
Kris Boudt
Professor of finance and econometrics


quantile() aplicată unui obiect ugarchroll.ugarchspec(): Specificați modelul GARCH de utilizat
garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "gjrGARCH"),
distribution.model = "sstd")
ugarchroll(): Estimați modelul GARCH pe eșantioane glisante
garchroll <- ugarchroll(garchspec, data = sp500ret, n.start = 2500,
refit.window = "moving", refit.every = 100)
quantile(): Calculați cuantila prezisă
garchVaR <- quantile(garchroll, probs = 0.05)
Puteți alege o altă probabilitate de pierdere: 1% și 2,5% sunt de asemenea populare
actual <- xts(as.data.frame(garchroll)$Realized, time(garchVaR))
VaRplot(alpha = 0.05, actual = actual, VaR = garchVaR)

O depășire VaR apare când randamentul actual este mai mic decât valoarea la risc prezisă: $ R_t \ < {VaR}_t$.
Frecvența depășirilor VaR se numește acoperire VaR.
# Calculation of coverage for S&P 500 returns and 5% probability level
mean(actual < garchVaR)
0.05159143
distribution.model = "std" în loc de distribution.model = "sstd":
garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "gjrGARCH"),
distribution.model = "std")
Estimare glisantă și predicție VaR 5%:
garchroll <- ugarchroll(garchspec, data = sp500ret, n.start = 2500,
refit.window = "moving", refit.every = 100)
garchVaR <- quantile(garchroll, probs = 0.05)
mean(actual < garchVaR) # returns 0.05783233
variance.model = list(model = "sGARCH")
în loc de
variance.model = list(model = "gjrGARCH"):
garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "sGARCH"),
distribution.model = "std")
Estimare glisantă și predicție VaR 5%:
garchroll <- ugarchroll(garchspec, data = sp500ret, n.start = 2500,
refit.window = "moving", refit.every = 100)
garchVaR <- quantile(garchroll, probs = 0.05)
mean(actual < garchVaR) # returns 0.06074475
refit.every = 1000
în loc de
refit.every = 100:
garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "sGARCH"),
distribution.model = "std")
garchroll <- ugarchroll(garchspec, data = sp500ret, n.start = 2500,
refit.window = "moving", refit.every = 1000)
garchVaR <- quantile(garchroll, probs = 0.05)
mean(actual < garchVaR) # returns 0.06199293
Modele GARCH în R