roots: Roots of a polynomial

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/filter.R

Description

Roots of a polynomial

Usage

1
roots(x, method = c("polyroot", "eigen"))

Arguments

x

Polynomial coefficients with coefficients given in order from highest to lowest polynomial power. This is the Matlab/Octave convention; it is opposite of the convention used by polyroot.

method

Either “polyroot” (default) which uses polyroot for its computations internally (and is typically more accurate) or “eigen” which uses eigenvalues of the companion matrix for its computation. The latter returns complex values in case of real valued solutions in less cases.

Value

A complex array with the roots of the polynomial.

Author(s)

Original Octave version by Kurt Hornik. Conversion to R by Tom Short.

References

Octave Forge https://octave.sourceforge.io/

See Also

polyroot, polyval, poly, conv

Examples

1
2
3
4
5
roots(1:3)
polyroot(3:1) # should be the same
poly(roots(1:3))

roots(1:3, method="eigen") # using eigenvalues

signal documentation built on May 25, 2021, 9:06 a.m.

Related to roots in signal...