September 2018
Intermediate to advanced
359 pages
8h 12m
English
Solving equations is central to numerical analysis, and R has numerous tools for doing so. We begin by extending our consideration of polynomials from the previous chapter.
The base installation of R has the function polyroot to find the zeros of a real or complex polynomial, specified by the vector of its coefficients in ascending order. This function uses the algorithm of Jenkins and Traub (Jenkins and Traub (1972) TOMS Algorithm 419. Comm. ACM, 15, 9799). For example,
> polyroot(c(4,5,6)) [1] -0.4166667+0.7021791i -0.4166667-0.7021791i
Using the package PolynomF , the code is a bit more cumbersome
> x = polynom() > (q = solve(4 + 5*x + 6*x^2)) # Solve ...