99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
2018-10-24 閱讀量: 1670
rugarch包編程問(wèn)題

如題,我想用rugarch包算時(shí)間序列的garch模型,包括外生變量,請(qǐng)問(wèn)該如何編,我的程序問(wèn)題在哪里。

數(shù)據(jù)見(jiàn)附件,1.我的變量維度是時(shí)間和國(guó)家,2.核心變量是 股指年收益率,3.外生變量是第9,10列數(shù)據(jù)。

aa<-read.csv("aa.csv",stringsAsFactors=F)

library(rugarch)

spec = ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1),external.regressors =aa[,9:10] ),

? ?? ???mean.model = list(armaOrder = c(1, 1),include.mean = TRUE, arfima = FALSE,external.regressors =aa[,9:10] ),

? ?? ?? ?distribution.model = "sged")

fit= ugarchfit(spec = spec,aa[,c(1:2,4)])

fit

報(bào)錯(cuò):

Error in optim(init[mask], armaCSS, method = optim.method, hessian = TRUE,??:

??'vmmin'的初始值不能為無(wú)窮大

解決方法:

gjr.spec <- ugarchspec( # start ugarch specification

? ? variance.model = list(model = "gjrGARCH", # select Treshold-GARCH

? ?? ?? ?? ?? ?? ?? ?? ???garchOrder = c(1, 1), # GARCH(1, 1), order c(1,1) is in fact the default

? ?? ?? ?? ?? ?? ?? ?? ???external.regressors = as.matrix(dfr[, "mon"])), # monday effect in variance

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?# given as an external regressor. Must be

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?# a matrix!

? ? mean.model = list(armaOrder = c(0, 1), # MA(1) specification

? ?? ?? ?? ?? ?? ?? ? external.regressors = as.matrix(dfr[, c("mon")])), # Monday effect in the returns

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?# must be a matrix!

? ? distribution.model = "sstd" # Student t as the conditional distribution

? ? ) # end??ugarch specification

0.0000
4
關(guān)注作者
收藏
評(píng)論(0)

發(fā)表評(píng)論

暫無(wú)數(shù)據(jù)
推薦帖子