GARCH modely v R
Kris Boudt
Professor of finance and econometrics


quantile() aplikovaná na objekt ugarchroll.ugarchspec(): Specifikujte, který model GARCH chcete použít
garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "gjrGARCH"),
distribution.model = "sstd")
ugarchroll(): Odhadněte model GARCH na rolujících vzorcích
garchroll <- ugarchroll(garchspec, data = sp500ret, n.start = 2500,
refit.window = "moving", refit.every = 100)
quantile(): Vypočítejte predikovaný kvantil
garchVaR <- quantile(garchroll, probs = 0.05)
Můžete zvolit jinou pravděpodobnost ztráty: oblíbené jsou také 1 % a 2,5 %
actual <- xts(as.data.frame(garchroll)$Realized, time(garchVaR))
VaRplot(alpha = 0.05, actual = actual, VaR = garchVaR)

Překročení VaR nastane, když skutečný výnos je nižší než predikovaná hodnota VaR: $ R_t \ < {VaR}_t$.
Frekvence překročení VaR se nazývá pokrytí VaR.
# Calculation of coverage for S&P 500 returns and 5% probability level
mean(actual < garchVaR)
0.05159143
distribution.model = "std" místo distribution.model = "sstd":
garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "gjrGARCH"),
distribution.model = "std")
Rolující odhad a predikce VaR na 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")
místo
variance.model = list(model = "gjrGARCH"):
garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "sGARCH"),
distribution.model = "std")
Rolující odhad a predikce VaR na 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
místo
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
GARCH modely v R