Question: Please show R code. Thanks Consider the time series given by {Y{ :t= -1,0, 1, ..., n} given by Y-1=1 Yo=1 Yt-zet Y = vt

 Please show R code. Thanks Consider the time series given by

Please show R code. Thanks

Consider the time series given by {Y{ :t= -1,0, 1, ..., n} given by Y-1=1 Yo=1 Yt-zet Y = vt where {et : t = -1,0,1,...} is a process of independent, normal random variables, each with mean u = 5 and variance 1. (a) (0.5 Points) Write R code to generate the values of Yt, t = -1,...,n for some given n (i.e. it should be a function in n). (Remark: you can use the function rnorm to simulate a normal random variable). (b) (0.5 Points) Run the program with n= 60. Report the output values. (c) (0.5 Points) Plot the values from the previous question. Comment on any features, and explain the long-term behaviour of the series; what happens if we take n = 80? n= 100? n= 500? (d) (1 Point) Display scatterplots for the time series vs. lag 1 and lag 2. Compute the covariance functions at lag 1 and lag 2. Comment on any features you observe. (You can use the zlag function in the TSA library to lag your time series. You can then plot it against your original time series to get your scatter plots. Do you see any correlation?) Consider the time series given by {Y{ :t= -1,0, 1, ..., n} given by Y-1=1 Yo=1 Yt-zet Y = vt where {et : t = -1,0,1,...} is a process of independent, normal random variables, each with mean u = 5 and variance 1. (a) (0.5 Points) Write R code to generate the values of Yt, t = -1,...,n for some given n (i.e. it should be a function in n). (Remark: you can use the function rnorm to simulate a normal random variable). (b) (0.5 Points) Run the program with n= 60. Report the output values. (c) (0.5 Points) Plot the values from the previous question. Comment on any features, and explain the long-term behaviour of the series; what happens if we take n = 80? n= 100? n= 500? (d) (1 Point) Display scatterplots for the time series vs. lag 1 and lag 2. Compute the covariance functions at lag 1 and lag 2. Comment on any features you observe. (You can use the zlag function in the TSA library to lag your time series. You can then plot it against your original time series to get your scatter plots. Do you see any correlation?)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!