R/ARToMA.R

`ARToMA` <-
function(phi, lag.max)
{
    p <- length(phi)
    x <- numeric(lag.max + 1)
    x <- 1
    for(i in 1:p) {
        x[i + 1] <- crossprod(phi[1:i], (rev(x))[1:i])
    }
    if(lag.max > p) {
        for(i in (p + 1):lag.max) {
            x[i + 1] <- crossprod(phi, (rev(x))[1:p])
        }
    }
    return(x)
}

Try the FitAR package in your browser

Any scripts or data that you put into this service are public.

FitAR documentation built on May 2, 2019, 3:22 a.m.