Displaying 2 results from an estimated 2 matches for "phihat1".
Did you mean:
phihat
2009 Nov 13
2
AR(2) modelling
...12, 215, 236)
#plot(myserie, type="l")
myserieminus0 <- tail(myserie, -2)
myserieminus1 <- tail(head(myserie, -1), -1)
myserieminus2 <- head(myserie, -2)
###Yule Walker equations
r1 <- cor(myserieminus0, myserieminus1)
r2 <- cor(myserieminus0, myserieminus2)
#method 1
phihat1 <- r1*(1-r2)/(1-r1^2)
phihat2 <- (r2-r1^2)/(1-r1^2)
#method 2
bigR <- cbind(c(1, r1), c(r1, 1))
smallr <- c(r1, r2)
ressolve <- solve(bigR, smallr)
resaryw <- ar(myserie, method="yule-walker", order.max=2, aic=FALSE)
cat("\t\tmanual YW 1\t\tmanual YW 2\t\tar YW\n...
2009 Nov 13
2
AR(2) modelling
...12, 215, 236)
#plot(myserie, type="l")
myserieminus0 <- tail(myserie, -2)
myserieminus1 <- tail(head(myserie, -1), -1)
myserieminus2 <- head(myserie, -2)
###Yule Walker equations
r1 <- cor(myserieminus0, myserieminus1)
r2 <- cor(myserieminus0, myserieminus2)
#method 1
phihat1 <- r1*(1-r2)/(1-r1^2)
phihat2 <- (r2-r1^2)/(1-r1^2)
#method 2
bigR <- cbind(c(1, r1), c(r1, 1))
smallr <- c(r1, r2)
ressolve <- solve(bigR, smallr)
resaryw <- ar(myserie, method="yule-walker", order.max=2, aic=FALSE)
cat("\t\tmanual YW 1\t\tmanual YW 2\t\tar YW\n...