# Is there a fast algorithm to check for AR(p) stationarity?

It is well-known that an AR(p) process $$x_t=\sum_{i=1}^p \varrho_i x_{t-i} + \epsilon_t \,,$$ is causal and stationary if and only if the roots of the polynomial $$\mathcal{P}(u) = 1 - \sum_{i=1}^p \varrho_i u^i$$ are all outside the unit circle in the complex plane. (Here is a Cross Validated discussion on the topic.)

My question is whether or not there exists a faster algorithm than the naïve one that consists in (a) finding the roots of $\mathcal{P}$ and (b) checking none one them is inside the unit circle.

-
This is a mathematical question. – vinux Jan 10 '12 at 12:53

1
@vinux: It is more of a computational question in that I am looking for the smallest power $d$ such that the answer can be produced in a time $\text{O}(p^d)$... – Xi'an Jan 10 '12 at 14:23

1
The process, as it's written is always causal. The condition about the roots tells if the system is stable - which implies stationarity. But it's more common to speak about stability conditions, rather than stationarity conditions, IMO. – leonbloy Apr 20 '12 at 18:39

## 2 Answers

The Schur-Cohn algorithm has $d=2$; this is what I learned in a computational statistics class at Berkeley some years ago.

-

1
Thank you, this is exactly what I was looking for. – Xi'an Jan 10 '12 at 15:43
For comparison purposes, do you also know of the order of an efficient root finder? – Xi'an Jan 10 '12 at 19:35

1
I think they are also $d=2$, using the following thought process. Evaluation of a p-degree polynomial is $O(p)$. Finding a single root should be independent of the order of the polynomial. After the root is found, the polynomial can be reduced to a polynomial of degree $p-1$, but this doesn't affect the order. So each of the $p$ roots takes $O(p)$ to find, leading to an $O(p^2)$ algorithm. – jbowman Jan 10 '12 at 20:49

1
– jbowman Jan 10 '12 at 20:55

2
– jbowman Jan 11 '12 at 15:22
show 1 more comment

It is unnecessary to find the $p$ complex roots as far as these are not to be used for themselves. Moreover, most (if not all) root finding processes can fail for large $p$.

Another solution is as follows. The $\mathrm{AR}(p)$ model can be reparametrised thanks to its $p$ partial autocorrelations (PACs) $\zeta_k$ for $1 \le k \le p$. The PACs are often denoted as $\phi_{k,k}$ because their computation involves an array $\phi_{k,\ell}$. There is a one-to-one correspondence between the vector $\boldsymbol{\rho}$ of the $p$ coefficients in the stationarity region and the vector $\boldsymbol{\zeta}$ in the region defined by the $p$ conditions $|\zeta_k | < 1$ for $1 \le k \le p$. The transformation "AR to PAC" $\boldsymbol{\rho} \mapsto \boldsymbol{\zeta}$ is quite simple and is given as a pretty recursion formula due to Barndorff-Nielsen and Schou. Testing stationarity from the vector of coefficients boils down to computing the $\zeta_k$ and stop as soon as one condition $| \zeta_k | \ge 1$ is found. The less well-known inverse transform "PAC to AR" $\boldsymbol{\zeta} \mapsto \boldsymbol{\rho}$ is available explicitly (due to Monahan), and is as simple as is the direct one. It might also be useful in some cases.

The two transformations are implemented (in R) in a CRAN R package named FitAR which provides as well an efficient `invertibleQ` function to test stationarity. The package is described in the following article where list of references is provided.

McLeod, A.I. and Zhang Y., "Improved Subset Autoregression: With R Package" Journal of Statistical Software, vol. 28, Issue 2, Oct 2008. http://www.jstatsoft.org/v28/i02

-

2
– leonbloy Apr 20 '12 at 18:34
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 28, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9421729445457458, "perplexity_flag": "head"}