# [R] Testing invertibility of an AR model

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Apr 10 07:49:09 CEST 2007

```The following is an internal function in arima()

arCheck <- function(ar) {
p <- max(which(c(1, -ar) != 0)) - 1
if (!p)
return(TRUE)
all(Mod(polyroot(c(1, -ar[1:p]))) > 1)
}

On Tue, 10 Apr 2007, Leeds, Mark (IED) wrote:

> I've looked around but I can't find the method in R for testing whether
> the resulting estimated coefficients
> of an AR model imply that the model is invertible.
>
> To quote from eric zivot's blue book :

Which really doesn't help us.  (I suspect you mean Zivot and Wang.)
This is standard times series material.

>
> " the AR(p) is invertible provided the rots of the characteristic
> equation
>
> Phi(z) = 1 - phi_1*z - phi_2*z^2 = phi_3*z^3 - ..... Phi_p*z^p = 0 lie
> outside
> the complex circle".
>
> I can't find a function nor do I know how to do the above myself. I
> think there is an equivalent method in which
> I can check whether the eigenvalues of some dual equation ( I forget
> what it is ) are less than one but I don't
> remember exactly what that equation is and , even if I did, I still
> wouldn't know how to do it.
>
> Maybe checking whether the absolute of the sum of the coefficients is
> less than one is okay ?
> I remember doing that in another life but I'm not sure if that's an
> approximation or an actual test.
>
>
> Thanks for any help.
> --------------------------------------------------------
>
> This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> and provide commented, minimal, self-contained, reproducible code.
>

--
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

```