Displaying 1 result from an estimated 1 matches for "ttheta".
Did you mean:
theta
2011 Jul 20
0
The C function getQ0 returns a non-positive covariance matrix and causes errors in arima()
...as apparently suggested by a referee to Gardner et
al. paper (see page 314 of their paper).
Q0bis <- function(phi,theta){
## Computes the initial covariance matrix for the state space
representation of Gardner et al.
p <- length(phi)
q <- length(theta)
r <- max(p,q+1)
ttheta <- c(1,theta,rep(0,max(p,q+1)-q-1))
A1 <- matrix(0,r,p)
B <- (col(A1)+row(A1)<=p+1)
C <- (col(A1)+row(A1)-1)
A1[B] <- phi[C[B]]
A2 <- matrix(0,r,q+1)
C <- (col(A2)+row(A2)-1)
B <- (C<=q+1)
A2[B] <- ttheta[C[B]]
A <- cbind(A1,A2)
if (...