polyroot(z)
i
th component of
z
is the coefficient of
x^(i-1)
.
The object is to find all solutions
x
of
z[i]*x^(i-1) + ... + z[2]*x + z[1] = 0
.
The algorithm to do so is described in Jenkins and Traub (1972) with
modifications from Withers (1974).
Box, G. E. P. and Jenkins, G. M. (1976).
Time Series Analysis: Forecasting and Control.
Holden-Day, Oakland, Calif.
Jenkins, M. A. and Traub, J. F. (1972).
Zeros of a complex polynomial.
Communications of the ACM
15, 97-99.
Withers, D. H. (1974).
Remark on algorithm 419.
Communications of the ACM
17, 157.
a <- c(0.5, .5, .3, .05) # some AR coefficients # Compute and plot the roots of the characteristic equation to # check for stationarity of the process (see Box and Jenkins, p. 55). root <- polyroot(c(1, -a)) plot(root) symbols(0, 0, circles=1, add=T, inches=F, col=5) # All roots outside the unit circle, implies a stationary process.