时间序列基本概念.pptx_第1页
时间序列基本概念.pptx_第2页
时间序列基本概念.pptx_第3页
时间序列基本概念.pptx_第4页
时间序列基本概念.pptx_第5页
已阅读5页,还剩27页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

时间序列基本概念,吴喜之,1,某些描述方法,2,3,#T2.1 n=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.2 n=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.3 n=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.4 n=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.5 n=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),8,#Difference operation removing the trend #As T2.1 n=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,# Difference operation removing the seasonal effect. set.seed(10); n=24;t=1:n;alpha=0;beta=2;e=rnorm(n,0,10);x=alpha+beta*t+e;m=n*30 y=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,# Difference operation removing both the trend and seasonal effect. 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*t1.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,#Correlation library(TeachingDemos) if(interactive() run.cor2.examp() x=-10:10;y=x2;plot(x,y);cor(x,y);a=lm(yx);abline(a) set.seed(0) x=arima.sim(n = 63, list(ar = c(0.8897, -0.4858), ma = c(-0.2279, 0.2488),sd = sqrt(0.1796) par(mfrow=c(2,3) plot(x) a=acf(x) y=zlag(x,1);plot(as.vector(x-1),as.vector(y-1),main=substitute(r=that,list(that=a$acf1) y2=zlag(x,2);plot(as.vector(x-1),as.vector(y2-1),main=substitute(r=that,list(that=a$acf2) #y3=zlag(x,3);plot(as.vector(x-1),as.vector(y3-1),main=substitute(r=that,list(that=a$acf3) y10=zlag(x,10);plot(as.vector(x-1),as.vector(y10-1),main=substitute(r=that,list(that=a$acf10) y14=zlag(x,14);plot(as.vector(x-1),as.vector(y14-1),main=substitute(r=that,list(that=a$acf14) par(mfrow=c(1,1),12,13,x=scan(“c:/xzwu/tjbook3/data/tax.txt“) tax=ts(x/100000, frequency = 12, start = c(1995, 1) ts.plot(tax,ylab=“Tax“,ylim=c(-1.2,11.6),main=“Monthly Tax in a Chinese City (in Billion RMB)“) a=stl(tax, “period“)#Seasonal Decomposition of Time Series by Loess #,a$time.series has 3 columns (seasonal, trend, remainder) par(mfrow=c(2,2) ts.plot(tax,ylab=“Tax“,ylim=c(-1.2,11.6),main=“Monthly Tax in a Chinese City (in Billion RMB)“) plot(a$time.series,1,col=2,type=“l“,ylim=c(-1,12) plot(a$time.series,2,col=2,type=“l“,ylim=c(-1,12) plot(a$time.series,3,col=2,type=“l“,ylim=c(-1,12) par(mfrow=c(1,1) ts.plot(tax,ylab=“Tax“,ylim=c(-1.2,11.6),main=“Monthly Tax in a Chinese City (in Billion RMB)“) lines(a$time.series,1,col=2) lines(a$time.series,2,col=3) lines(a$time.series,3,col=4),14,15,ts.plot(tax,ylab=“Tax“,ylim=c(-1.2,11.6),main=“Monthly Tax in a Chinese City (in Billion RMB)“) lines(a$time.series,1,col=2);lines(a$time.series,2,col=3);lines(a$time.series

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论