Displaying 1 result from an estimated 1 matches for "mainvert".
Did you mean:
invert
2009 Mar 06
0
modifying a built in function from the stats package (fixing arima) (CONCLUSIONS)
...all(R_ARIMA_CSS, x, arma, trarma[[1]], trarma[[2]],
as.integer(ncond), FALSE)
0.5 * log(res)
}
arCheck <- function(ar) {
p <- max(which(c(1, -ar) != 0)) - 1
if (!p)
return(TRUE)
all(Mod(polyroot(c(1, -ar[1:p]))) > 1)
}
maInvert <- function(ma) {
q <- length(ma)
q0 <- max(which(c(1, ma) != 0)) - 1
if (!q0)
return(ma)
roots <- polyroot(c(1, ma[1:q0]))
ind <- Mod(roots) < 1
if (all(!ind))
return(ma)
if (q0 == 1)
retu...