#——1999年中国年纱产量序列时序图()=("C:\\Users\\Administrator\\Desktop\\",header=T)#如果有标题,用T;没有标题用Fplot(,type='o')#=[,2]=acf()#()=("C:\\Users\\Administrator\\Desktop\\",header=F)=(t(()))[1:168]#矩阵转置转向量plot(,type='l')#()#把字去掉pacf()#——=("C:\\Users\\Administrator\\Desktop\\",header=T)plot(,type='o')##不会定义坐标轴#=[,2]=acf()#(,type="Ljung-Box",lag=6)(,type="Ljung-Box",lag=12)#,=rnorm(1000,0,1)(,type='l')#=acf()#(,type="Ljung-Box",lag=6)(,type="Ljung-Box",lag=12)#——=("C:\\Users\\Administrator\\Desktop\\",header=T)plot(,type='o',xlim=c(1950,2010),ylim=c(60,100))=[,2]=acf()#(,type="Ljung-Box",lag=6)(,type="Ljung-Box",lag=12)#()pacf()#根据自相关系数图和偏自相关系数图可以判断为AR(1)模型##P83arima(,order=c(1,0,0),method="ML")#极大似然估计ar1=arima(,order=c(1,0,0),method="ML")summary(ar1)ev=ar1$residualsacf(ev)pacf(ev)#参数的显著性检验t1==pt(t1,df=48,=F)*2#ar1的显著性检验t2==pt(t2,df=48,=F)*2#(ev,type="Ljung-Box",lag=6,fitdf=1)(ev,type="Ljung-Box",lag=12,fitdf=1)#(arima(,order=c(1,0,0)),=5)=predict(arima(,order=c(1,0,0)),=5)U=$pred+*$seL=$pred-*$seplot(c(,$pred),type="l",col=1:2)lines(U,col="blue",lty="dashed")lines(L,col="blue",lty="dashed")##((n=100,list(ar=
时间序列分析r语言程序 来自淘豆网m.daumloan.com转载请标明出处.