모형 리스크: 잘못된 모형 사용의 위험

R에서의 GARCH 모델

Kris Boudt

Professor of finance and econometrics

모형 리스크의 원인과 해결책

출처:

  • 모형 선택
  • 최적화의 시작값
  • 수익률의 이상치

해결: 견고한 접근으로 보호하기

  • 모형 평균: 여러 모형의 예측을 평균
  • 여러 시작값을 시도하고 최대 가능도를 주는 값을 선택
  • 데이터 정제
R에서의 GARCH 모델

모형 평균

variance.models <- c("sGARCH", "gjrGARCH")
distribution.models <- c("norm", "std", "sstd")
c <- 1
for (var.model in variance.models) {
    for (dist.model in distribution.models) {
        garchspec <- ugarchspec(mean.model = list(armaOrder = c(0, 0)),
         variance.model = list(model = var.model), distribution.model = dist.model)
        garchfit <- ugarchfit(data = msftret, spec = garchspec)
        if (c==1) { msigma <- sigma(garchfit)
        } else { msigma <- merge(msigma, sigma(garchfit))} 
        c <- c + 1 }
}
R에서의 GARCH 모델

R에서의 GARCH 모델

평균 변동성 예측

avesigma <- xts(rowMeans(msigma), order.by = time(msigma))

베타의 정의

R에서의 GARCH 모델

시작값에 대한 견고성

coef(garchfit)
          mu        omega       alpha1        beta1         skew        shape 
5.669200e-04 6.281258e-07 7.462984e-02 9.223701e-01 9.436331e-01 6.318621e+00 
  • 이 추정치는 가능도 함수를 복잡하게 최적화한 결과입니다
  • 최적화는 수치적·반복적이며 시작값에 민감할 수 있습니다
  • rugarch는 합리적 시작값을 위한 기본 방식을 제공합니다
  • ugarchspec() GARCH 사양에 setstart()를 적용해 시작값을 직접 지정할 수 있습니다
R에서의 GARCH 모델

기본 시작값으로 추정

garchspec <- ugarchspec(mean.model = list(armaOrder = c(0,0)),
                        variance.model = list(model = "sGARCH"),
                        distribution.model = "sstd")

garchfit <- ugarchfit(data = sp500ret, spec = garchspec)
coef(garchfit)
          mu        omega       alpha1        beta1         skew        shape 
5.669200e-04 6.281258e-07 7.462984e-02 9.223701e-01 9.436331e-01 6.318621e+00 
likelihood(garchfit)
24280.33
R에서의 GARCH 모델

수정한 시작값으로 추정

garchspec <- ugarchspec(mean.model = list(armaOrder = c(0, 0)),
  variance.model = list(model = "sGARCH"), distribution.model = "sstd")
setstart(garchspec) <- list(alpha1 = 0.05, beta1 = 0.9, shape = 8)
garchfit <- ugarchfit(data = sp500ret, spec = garchspec)
coef(garchfit)
          mu        omega       alpha1        beta1         skew        shape 
5.638002e-04 6.303949e-07 7.466503e-02 9.224117e-01 9.438978e-01 6.309185e+00
likelihood(garchfit) # returns 24280.33
R에서의 GARCH 모델

데이터 정제

  • 이상치가 변동성 예측을 왜곡하지 않도록 합니다
  • 방법: 윈저라이제이션. PerformanceAnalyticsReturn.clean()에서 method = "boudt"로 수익률의 크기를 허용 범위로 줄입니다:
# 수익률 시계열 정제
library(PerformanceAnalytics)
clmsftret <- Return.clean(msftret, method = "boudt")
# 서로 겹쳐 그리기
plotret <- plot(msftret, col = "red")
plotret <- addSeries(clmsftret, col = "blue", on = 1)
R에서의 GARCH 모델

베타의 정의

R에서의 GARCH 모델

정제가 변동성 예측에 미치는 영향

원시 및 정제된 Microsoft 수익률로 변동성을 예측합니다

garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
     variance.model = list(model = "gjrGARCH"), distribution.model = "sstd")
garchfit <- ugarchfit(data = msftret, spec = garchspec)
clgarchfit <- ugarchfit(data = clmsftret, spec = garchspec)

시계열 그래프로 비교합니다

plotvol <- plot(abs(msftret), col = "gray")
plotvol <- addSeries(sigma(garchfit), col = "red", on = 1)
plotvol <- addSeries(sigma(clgarchfit), col = "blue", on = 1)
plotvol
R에서의 GARCH 모델

베타의 정의

R에서의 GARCH 모델

견고하게 하라: 대충 맞는 편이 정확히 틀리는 것보다 낫다

R에서의 GARCH 모델

Preparing Video For Download...