GARCH Models in R
Kris Boudt
Professor of finance and econometrics
จากโมเดล GARCH ที่ประมาณค่าได้:

การนำไปใช้
e <- residuals(tgarchfit)
mean(e ^ 2)
โมเดล GARCH ให้ผลลัพธ์:

การนำไปใช้
e <- residuals(tgarchfit)
d <- e ^ 2 - sigma(tgarchfit) ^ 2
mean(d ^ 2)
tgarchspec <- ugarchspec(mean.model = list(armaOrder = c(0, 0)),
variance.model = list(model = "sGARCH", variance.targeting = TRUE),
distribution.model = "std")
tgarchfit <- ugarchfit(data = EURUSDret, spec = tgarchspec)
# Compute mean squared prediction error for the mean
e <- residuals(tgarchfit) ^ 2
mean(e ^ 2) # 3.836205e-05
# Compute mean squared prediction error for the variance
d <- e ^ 2 - sigma(tgarchfit) ^ 2
mean(d ^ 2) # 5.662366e-09
likelihood(tgarchfit) # returns 18528.58
วิเคราะห์โดยเปรียบเทียบกับโมเดลอื่น:
# Complex model with many parameters
flexgarchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "gjrGARCH"),
distribution.model = "sstd")
flexgarchfit <- ugarchfit(data = EURUSDret, spec = flexgarchspec)
likelihood(flexgarchfit) # returns 18530.49
ข้อควรระวัง: ใช้แนวทางการประเมินแบบ in-sample ซึ่งตัวอย่างที่ใช้ประมาณค่าและประเมินผลเป็นชุดเดียวกัน
ความเสี่ยงของ overfitting:
Overfitting คือการเลือกโมเดลที่ซับซ้อนเกินไป ซึ่งเหมาะสมกับผลตอบแทนในตัวอย่างที่ใช้ประมาณค่า แต่ไม่เหมาะสมกับผลตอบแทนในอนาคตที่อยู่นอกตัวอย่าง
information criteria = - likelihood + penalty(number of parameters)
หลักเกณฑ์เบื้องต้นในการตัดสินใจ:
เลือกโมเดลที่มีเกณฑ์สารสนเทศต่ำที่สุด
เมธอด infocriteria() แสดงเกณฑ์สารสนเทศสำหรับบทลงโทษแบบต่างๆ
infocriteria(tgarchfit)
out
Akaike -7.468081
Bayes -7.462833
Shibata -7.468083
Hannan-Quinn -7.466241
`
การตีความต้องเปรียบเทียบกับเกณฑ์สารสนเทศของโมเดลอื่น
tgarchspec <- ugarchspec(mean.model = list(armaOrder = c(0, 0)),
variance.model = list(model = "sGARCH", variance.targeting = TRUE),
distribution.model = "std")
tgarchfit <- ugarchfit(data = EURUSDret, spec = tgarchspec)
length(coef(tgarchfit)) # only 5 parameters
likelihood(tgarchfit) # equals 18528.58
flexgarchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
variance.model = list(model = "gjrGARCH"), distribution.model = "sstd")
flexgarchfit <- ugarchfit(data = EURUSDret, spec = flexgarchspec)
length(coef(flexgarchfit)) # we now have 8 parameters
likelihood(flexgarchfit) # 18530.49: likelihood increased
Likelihood สูงกว่าดีกว่า เกณฑ์สารสนเทศต่ำกว่าดีกว่า
infocriteria(tgarchfit) # Simple model
Akaike -7.468435
Bayes -7.464499
infocriteria(flexgarchfit) # Complex model
Akaike -7.467239
Bayes -7.456742
โมเดลอย่างง่ายมีเกณฑ์สารสนเทศต่ำที่สุด จึงควรเลือกใช้ในกรณีนี้
tgarchfit <- ugarchfit(data = msftret, spec = tgarchspec)
flexgarchfit <- ugarchfit(data = msftret, spec = flexgarchspec)
infocriteria(tgarchfit)
Akaike -5.481895
Bayes -5.477833
infocriteria(flexgarchfit)
Akaike -5.489087
Bayes -5.478255
โมเดลที่ซับซ้อนมีเกณฑ์สารสนเทศต่ำที่สุด จึงควรเลือกใช้ในกรณีนี้
GARCH Models in R