R中时间序列的函数:arima(x, order=c(p,d,q))
数据模拟:x = arima.sim(list(order=c(1,0,0), ar=.9), n=100) + 50
arima(x, order = c(1, 0, 0))
Call:
arima(x = x, order = c(1, 0, 0))
Coefficients:
ar1 intercept ----------请注意这里的intercept其实表示mean
0.8517 50.9829 --------ar1下面的系数表示AR模型中的系数
s.e. 0.0527 0.6601
请注意:这个结果表达的含义是:
x(t+1)-50.9829=0.8517*(x(t)-50.9829)+w(t)
而不是:x(t+1)=0.8517*x(t)+50.9829+w(t)
预测函数:predict(model, n.ahead=T)