U3

eg:3-1 观察如下四个AR模型的平稳性

> x1<-arima.sim(n=100,list(ar=0.8))
> e<-rnorm(100)
> ts.plot(x1)
> x2<-filter(e,filter=-1.1,method="recursive")
> e<-rnorm(100)
> ts.plot(x2)
> x3<-arima.sim(n=100,list(ar=c(1,-0.5)))
> ts.plot(x3)
> x4<-filter(e,filter=c(1,0.5),method="recursive")
> ts.plot(x4)
> x1<-arima.sim(n=100,list(ar=-1.1))
Error in arima.sim(n = 100, list(ar = -1.1)) : 模型的'ar'部分不平穩
> x3<-arima.sim(n=100,list(ar=c(1,0.5)))
Error in arima.sim(n = 100, list(ar = c(1, 0.5))) : 模型的'ar'部分不平穩

笔记:https://zhuanlan.zhihu.com/p/25713408
rnorm函数:https://blog.csdn.net/OYY_90/article/details/82226334
arima.sim()函数:https://www.jianshu.com/p/5691621e4ac5

你可能感兴趣的:(U3)