Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Extend the first order case of the AR(1) model to the AR(2) case. Detail how the variance of the predictions is computed. Simulate this with

Extend the first order case of the AR(1) model to the AR(2) case. Detail how the variance of the predictions is computed. Simulate this with an empirical example where Ptt+1 is computed for one-step ahead under a Gaussian error. AR(1) Example: # Number of observations N <- 500 # Simulation x <- arima.sim(list(ar=0.9), n=N) # Durbin-Levinson algorithm DLalgo <- function(x) { T <- length(x) # MSE matrix P <- matrix(0,T,1) # Phi matrix phi <- matrix(0,T,1) # Get the rhos rhos <- acf(x, lag.max=length(x), plot=FALSE)$acf # Intialize for an AR(1) phi[1,1] <- rhos[1,1,1] P[1,1] <- var(x)/(1-phi[1,1]^2) # Now loop over the computation for(i in 2:length(x)) { phi[i-1,1] <- (rhos[i-1,1,1] sum(phi[(T-i-1)]*rhos[T-i,1,1])) / (1-sum(rhos[-i,1,1])) } # print out the results print(DLalgo(x)[1:10]) > print(DLalgo(x)[1:10]) [1] 0.7162427 0.6905250 0.6612465 0.6315899 0.5995472 0.5495968 0.5181615 [8] 0.4748376 0.4370178 0.3894195

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Algebra Math 1st Grade Workbook

Authors: Jerome Heuze

1st Edition

979-8534507850

More Books

Students also viewed these Mathematics questions