[R] multiroot() anyone?

Paul Gilbert
2002-03-20T15:27:51Z

Mai Zhou wrote:
>
> Dear list, Did anybody have something like multiroot(),
> similar to uniroot() only for several varibles/function?
>
> I know the difficulty several varibles bring. But for
> nice functions, it can be useful.
>
> We are thinking of writing one....I thought to ask first.
>
> Mai Zhou

If you can think of your function as a matrix polynomial then you can
find roots using polyroot() on the determinant of the polynomial matrix.
There are utilities in dse1 in the dse bundle on CRAN to do this. They
are oriented toward time series models but can pretty easily be trick to
work on a polynomial matrix. (I've sometimes considered organizing them
into a separate, more general package, but never had the time.) Please
note that this is not a very good way to do the calculation if there are
many roots, because of numerical conditioning problems in the polynomial
determinant representation. The default method in dse uses a different
calculation which is much more accurate for large problems.

Paul Gilbert