文档详情

时间序列基本概念.pptx

发布:2025-04-04约4.1千字共32页下载文档
文本预览下载声明

时间序列基本概念吴喜之1

某些描述方法2

3#T2.1n=200;t=1:n;alpha=0;beta=2;e=rnorm(n,0,10);x=alpha+beta*t+e;par(mfrow=c(2,2));plot(t,x,type=l);plot(t,beta*t,type=l);plot(t,e,type=l,ylim=c(0,400));par(mfrow=c(1,1))

4#T2.2n=200;t=seq(0,6,len=n);e=rnorm(n);alpha=0;gamma=3;x=alpha+gamma*cos(t*5)+e;par(mfrow=c(2,2));plot(t,x,type=l);plot(t,gamma*cos(t*5),type=l,ylim=c(-5,5));plot(t,e,type=l,ylim=c(-5,5));par(mfrow=c(1,1))

5#T2.3n=200;t=seq(0,6,len=n);e=rnorm(n);alpha=0;beta=6;gamma=3;x=alpha+beta*t+gamma*cos(t*5)+e;par(mfrow=c(2,2));plot(t,x,type=l);plot(t,gamma*cos(t*5),type=l,ylim=c(-5,40));plot(t,beta*t,type=l,ylim=c(-5,40));plot(t,e,type=l,ylim=c(-5,40));par(mfrow=c(1,1))

6#T2.4n=200;t=seq(0,6,len=n);e=rnorm(n,0,2);alpha=0;beta=6;gamma=.2;x=(alpha+beta*t)*(gamma*cos(t*5))+e;par(mfrow=c(2,2));plot(t,x,type=l);plot(t,gamma*cos(t*5),type=l);plot(t,beta*t,type=l);plot(t,e,type=l);par(mfrow=c(1,1))

7#T2.5n=200;t=seq(0,6,len=n);e=rnorm(n,0,2);alpha=0;beta=6;gamma=.2;x=(alpha+beta*t)*(gamma*cos(t*5))*epar(mfrow=c(2,2));plot(t,x,type=l);plot(t,gamma*cos(t*5),type=l);plot(t,beta*t,type=l);plot(t,e,type=l);par(mfrow=c(1,1))

8#Differenceoperationremovingthetrend#AsT2.1n=200;t=1:n;alpha=0;beta=2;e=rnorm(n,0,10);x=alpha+beta*t+e;par(mfrow=c(2,1));plot(t,x,type=l);plot(t[-1],diff(x),type=l,ylim=c(-300,300));par(mfrow=c(1,1))

9#Differenceoperationremovingtheseasonaleffect.set.seed(10);n=24;t=1:n;alpha=0;beta=2;e=rnorm(n,0,10);x=alpha+beta*t+e;m=n*30y=rep(x,30)+rnorm(m);t=1:m;par(mfrow=c(2,1));plot(t,y,type=l);plot(t[-(1:24)],diff(y,24),type=l,ylim=c(-10,50));par(mfrow=c(1,1))

10#Differenceoperationremovingboththetrendandseasonaleffect.set.seed(10);n=24;t=1:n;alpha=0;beta=2;e=rnorm(n,0,20);x=alpha+beta*t+e;m=n*30;gamma=.2;t=1:m;y=rep(x,30)+gamma*t^1.35+rnorm(m);par(mfrow=c(1,2));plot(t,y,type=l);plot(t[-(1:25)],diff(diff(y,1),24),type=l,ylim=c(-10,50));par(mfrow=c(1,1))

11#Correlationlibrary(TeachingDemos)if(interactive()){run.cor2.examp()}x=-10:10;y=x^2;plot(x,y);co

显示全部
相似文档