Next: popmodel() Up: MacAnova Help File Previous: polygamma()   Contents

polyroot()

Usage:
polyroot(coefs), coefs a REAL matrix



Keywords: time series, complex arithmetic
                                  Usage
polyroot(Coef) computes the real and possibly complex roots of the
polynomials specified by the columns of REAL matrix Coef.  If c[i] is
Coef[i,j], then the polynomial whose roots are found is
  x^n - c[1]*x^(n-1) - c[2]*x^(n-2) - ... - c[n-1]*x - c[n],
where n = nrows(Coef).  Note that the leading coefficient (of x^n) is 1,
and the coeficients are associated with descending powers of x.

NOTE: The sign assumed for Coef is not affected by variables ARSIGN or
MASIGN which are recognized by several macros in file Arima.mac.  Type
arimahelp(MASIGN) for details.

If Coef is n by m, the result returned is a n by 2*m matrix with the
real and imaginary parts of the roots associated with column j of Coef
in columns 2*j-1 and 2*j, that is in the standard fully complex form.
See topic 'complex'.

To find the roots of polynomial d[1]*x^n+d[2]*x^(n-1)+...+d[n]*x+
d[n+1], use polyroot(-d[-1]/d[1]) (when d is a matrix use
polyroot(-d[-1,]/d[1,])).

To find the roots of polynomial d[1]+d[2]*x+d[3]*x^2...+d[n+1]*x^n, use
polyroot(-reverse(d[-(n+1)])/d[n+1]) (when d is a matrix use
polyroot(-reverse(d[-(n+1),])/d[n+1,])).  See reverse().

                     Use with autoreg() and movavg()
The form of the argument to polyroot is adapted to its use in evaluating
autoregressive and moving average operators.  If phi is a REAL vector
and x is a vector of white noise, autoreg(phi,x) generates a stationary
autoregressive series if and only if the roots computed by polyroot(phi)
are inside the unit circle, that is, max(creal(cpolar(polyroot(phi)))) <
1.  Similarly, movavg(theta,x) generates an invertible moving average
model if and only if all the roots computed by polyroot(theta) lie
inside the unit circle.

                            Cross references
See also topics autoreg(), movavg(), 'complex' and subtopic
'matrices:"complex_matrices".


Gary Oehlert 2005-08-12