Description Usage Arguments Value Author(s)
Tries to find the zero of a function by using the bisection method
(uniroot
). To call
uniroot
, the zero must be bracketed by
finding two points at which the function value has opposite
signs. The main code in this function is a grid search to find
such a pair of points. A geometric grid of points between
lower
and guess
and also between guess
and
upper
. This grid is searched for two neighbouring points
across which the function changes sign. This brackets the root,
and then we try to locate the root by calling
uniroot
1 | bisection.root(f, guess, lower, upper, nstep = 100, toler = 1e-06)
|
f |
The function whose zero is to be found. An R function object that takes one numeric argument and returns a numeric value. In an IRR application, this will be the NPV function. In an implied volatility application, the value will be the option price. |
guess |
The starting value (guess) from which the solver starts searching for the root. Must be positive. |
lower |
The lower end of the interval within which to search for the root. Must be positive. |
upper |
The upper end of the interval within which to search for the root. Must be positive. |
nstep |
The number of steps in the grid search to bracket the zero. See details. |
toler |
The criterion to determine whether a zero has been
found. This is passed on to |
The root (or NA if the method fails)
Prof. Jayanth R. Varma
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.