Re: [問題] 迴圈不會跑...

看板R_Language作者 (攸藍)時間11年前 (2013/06/18 12:26), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串3/3 (看更多)
: [程式範例]: : garch <- garchFit(~garch(1,1),data=r.ts, trace=F) : magarch <- garchFit(~arma(0,1)+garch(1,1),data=r.ts, trace=F) : resgarch <-residuals(garch) : resmagarch <-residuals(magarch) : resgarch2 <-resgarch^2 : resmagarch2 <-resmagarch^2 把result用list存起來即可,之後要看在一抓出來慢慢看 resgarch.res.l = as.list(NULL) resmagarch.res.l = as.list(NULL) resgarch2.res.l = as.list(NULL) resmagarch2.res.l = as.list(NULL) for (i in 1:20) { resgarch.res.l[[i]] = Box.test(resgarch, lag = i, type = "Ljung-Box") resmagarch.res.l[[i]] = Box.test(resmagarch, lag = i, type = "Ljung-Box") resgarch2.res.l[[i]] = Box.test(resgarch2, lag = i, type = "Ljung-Box") resmagarch2.res.l[[i]] = Box.test(resmagarch2, lag = i, type = "Ljung-Box") } : [關鍵字]: : Box.test, Ljung-Box, for loop, GARCH -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.116.152.191

06/18 20:00, , 1F
謝謝!
06/18 20:00, 1F
文章代碼(AID): #1Hl-610d (R_Language)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):
文章代碼(AID): #1Hl-610d (R_Language)