Unit 27 ARMA(p,q)

27.1 Some math

ˆXt0()=pj=1ϕjˆXt0(j)qj=θj^at0+j+ˉX[1pi=1ϕi] Where the a hat is incredibly hard to calculate (we have to do back casting, which we can worry about after the test). Challeng: Write this function recursively (is it possible?????) in R. We are just going to use fore.arma.wge for now

ts7524 <- tswgen(75, sn = 24)
p <- c(1.6, -0.8)
thet <- (-0.9)
x1 <- ts7524$arma(phi = p)

fore.arma.wge(x1, phi = p, n.ahead = 20, limits = F)

x2 <- ts7524$arma(phi = p, theta = thet)

fore.arma.wge(x2, phi = p, theta = thet, n.ahead = 20, limits = F)