另一些時序的function

看板NTHU_STAT96作者 (tsta)時間17年前 (2008/05/06 20:35), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
z=arima.sim(list(order=c(2,1,0),ar=c(-0.5,0.4)),n=500) #例如說data長這樣 par(mfrow=c(2,1));acf(z);pacf(z) #看acf 及pacf #看起來好像要做差分 z1=diff(z,lag=1) #做差分用的 par(mfrow=c(2,1));acf(z1);pacf(z1) #看acf 及pacf #看起來好像是AR(2) mod=arima(z[1:400],order=c(2,1,0)) predict(mod, n.ahead = k) #預測未來k期 #似乎沒有比較簡單的辦法去update 新的資料 #除非是像課本上用psi去update新的資料 ## arima(x, order = c(0, 0, 0), seasonal = list(order = c(0, 0, 0), period = NA), xreg = NULL, include.mean = TRUE, transform.pars = TRUE, fixed = NULL, init = NULL, method = c("CSS-ML", "ML", "CSS"), n.cond, optim.control = list(), kappa = 1e6) 大概就這些啦~~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.114.36.142 ※ 編輯: tsta 來自: 140.114.36.142 (05/07 08:58)
文章代碼(AID): #18852clV (NTHU_STAT96)