GARCH Models in R
Kris Boudt
Professor of finance and econometrics


quantile() กับออบเจกต์ ugarchrollugarchspec(): ระบุโมเดล GARCH ที่ต้องการใช้
garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "gjrGARCH"),
distribution.model = "sstd")
ugarchroll(): ประมาณโมเดล GARCH บนตัวอย่างการประมาณแบบ rolling
garchroll <- ugarchroll(garchspec, data = sp500ret, n.start = 2500,
refit.window = "moving", refit.every = 100)
quantile(): คำนวณ quantile ที่คาดการณ์
garchVaR <- quantile(garchroll, probs = 0.05)
สามารถเลือกความน่าจะเป็นของการขาดทุนอื่นได้: 1% และ 2.5% ก็เป็นที่นิยมเช่นกัน
actual <- xts(as.data.frame(garchroll)$Realized, time(garchVaR))
VaRplot(alpha = 0.05, actual = actual, VaR = garchVaR)

VaR exceedance เกิดขึ้นเมื่อผลตอบแทนจริงต่ำกว่า value-at-risk ที่คาดการณ์: $ R_t \ < {VaR}_t$
ความถี่ของ VaR exceedance เรียกว่า VaR coverage
# Calculation of coverage for S&P 500 returns and 5% probability level
mean(actual < garchVaR)
0.05159143
distribution.model = "std" แทน distribution.model = "sstd":
garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "gjrGARCH"),
distribution.model = "std")
การประมาณแบบ rolling และการคาดการณ์ 5% VaR:
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")
แทน
variance.model = list(model = "gjrGARCH"):
garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "sGARCH"),
distribution.model = "std")
การประมาณแบบ rolling และการคาดการณ์ 5% VaR:
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
แทน
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 Models in R