Using R statistical software
(a) Generate n = 100 observations from following time series model xt =2cos(2πt/4)+ωt, where ωt is i.i.d N(0,1). (b) Apply the moving average to xt and get time series yt, such that yt = (xt + xt−1 + xt−2 + xt−3)/4. [hint: Use filter(x,rep(1/4,4)),sides=1] (c) Plot xt as a line and superimpose yt as a dashed line. (d) Describe the relationship between xt and yt.
The R code is given as follows
The graph is given as follows
The relationship between y(t) and x(t) is that y(t) is a smoother version of x(t) since some noise or randomness of the data was removed by the moving average method. This can also be very well observed in the above graph.
Get Answers For Free
Most questions answered within 1 hours.