bisection.root: Find zero of a function by bracketing the zero and then using...

Description Usage Arguments Value Author(s)

View source: R/solve-irr.R


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


bisection.root(f, guess, lower, upper, nstep = 100, toler = 1e-06)



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.


The starting value (guess) from which the solver starts searching for the root. Must be positive.


The lower end of the interval within which to search for the root. Must be positive.


The upper end of the interval within which to search for the root. Must be positive.


The number of steps in the grid search to bracket the zero. See details.


The criterion to determine whether a zero has been found. This is passed on to uniroot


The root (or NA if the method fails)


Prof. Jayanth R. Varma

jrvFinance documentation built on Nov. 5, 2021, 5:07 p.m.