如何在GARCH模型中使用ARIMA [英] How to use ARIMA in GARCH model
问题描述
我有财务数据,我的目标是能够进行预测.我运行了一个arima模型,发现最合适的是arima(1,1,1)w/漂移.我想在数据集上使用GARCH,因为由于波动性,它是更好的模型,当我对残差求平方时,确实具有拱效应.但是我知道GARCH接受2参数Arima,但我不确定它如何从我现在拥有的3参数Arima中转换.
I have financial data and my goal is to be able to forecast. I ran an arima model and found that the best fit was arima(1,1,1) w/ drift. I want to use GARCH on the data set because it is the better model to use due to volatility and when I squared my residuals it did have the arch effect. But I know that GARCH takes in a 2 parameter arima and I am not sure how that translates from the 3 parameter arima I currently have.
library(dplyr)
library(tidyr)
library(lubridate)
library(ggplot2)
library(TSA)
library(forecast)
spnew<-read.csv(file="~/Desktop/SPNEW.csv", header=T,
sep=",",check.names=FALSE)
sfts1=ts(sp$`Adj Close`,
freq=260,start=decimal_date(ymd("2009-01-02")))
arsf1=auto.arima(sfts1, trace=T)
我有要为GARCH运行的代码,但不确定为Arima部分输入什么.
I have the code to run for GARCH but am not sure what to input for the arima portion.
model1 <- ugarchspec(variance.model = list(model="sGARCH",
garchOrder=c(_,_)),
mean.model = list(armaOrder=c(_,_)),
distribution.model = "norm")
mod2 <- ugarchfit(spec=model1,
data=sfts1)
我将需要输入的内容留空.一旦知道如何放入Arima,我将按照garch顺序进行操作.如果知道更好的GARCH模型代码编写方法,请告诉我.
I left blanks for what I would need to input. I will play with the garch order once I know how to put in arima. If a better way to code the GARCH model is known please let me know.
推荐答案
下面,我将称为2参数arima的模型称为ARMA. rugarch :: ugarchspec()
可以将ARMA(p,q)或ARFIMA(p,d,q)模型视为 mean.model
.
(注意:当d为整数时,ARFIMA(p,d,q)等同于ARIMA(p,d,q))
Below, I refer to the model that you call 2 parameter arima as ARMA.
rugarch::ugarchspec()
can treat ARMA(p, q) or ARFIMA(p, d, q) model as mean.model
.
(NOTE: when d is integer, ARFIMA(p, d, q) is equivalent to ARIMA(p, d, q))
这是我的例子;
p <- 1
q <- 1
# d <- 1 # if you want to fix d
model1 <- ugarchspec(variance.model = list(model="sGARCH",
garchOrder=c(_, _)),
mean.model = list(armaOrder=c(p, q),
arfima = T), # using arfima model
# fixed.pars=list(arfima = d), # If you want to fix d
distribution.model = "norm"))
这篇关于如何在GARCH模型中使用ARIMA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!