{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

slide_091021_code - #1 zero mean iid series(normal...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 ##1. zero mean iid series (normal) plot(rnorm(50)) ts.plot(rnorm(50)) ts.plot(rnorm(100)) ts.plot(rnorm(100,mean=0,sd=0.1)) ts.plot(rnorm(100,mean=0,sd=5)) ##2. random walk (binary) rw <- cumsum(c(0,sample(c(-1,1), 1000, rep = T))) plot(rw) ts.plot(rw) ##3. simulation ## AR 1 sim.AR1<-arima.sim(list(ar=c(0.2)), n=200) plot(sim.AR1) ## stationary par(mfrow=c(2,1)) acf(sim.AR1, type="covariance") acf(sim.AR1, type="correlation") sim.AR1<-arima.sim(list(ar=c(-0.6)), n=200) plot(sim.AR1) ## stationary par(mfrow=c(2,1)) acf(sim.AR1, type="covariance") acf(sim.AR1, type="correlation") sim.AR1<-arima.sim(list(ar=c(1.2)), n=200) ## not stationary a1<-1.2 T<-20 series<-array(0,T) series[1]<-rnorm(1) for (i in 2:T) series[i]<-a1*series[i-1]+rnorm(1) ts.plot(series) ## AR 2 sim.AR2<-arima.sim(list(ar=c(0.4, 0.2)), n=1000) plot(sim.AR2) par(mfrow=c(2,1)) acf(sim.AR2, type="covariance") acf(sim.AR2, type="correlation") sim.AR2<-arima.sim(list(ar=c(1/6, 1/6)), n=1000)
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Sheet1 Page 2 plot(sim.AR2) sim.AR2<-arima.sim(list(ar=c(1/3, 2/9)), n=1000) plot(sim.AR2) sim.AR2<-arima.sim(list(ar=c(1, 0.2)), n=1000) plot(sim.AR2) a1<-1 a2<-0.2 T<-20 series<-array(0,T) series[1]<-rnorm(1)
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern