Description Usage Arguments Details Value Author(s)
This function computes the internal rate of return at which the
net present value equals zero. It requires as input a function
that computes the net present value of a series of cash flows for
a given interest rate as well as the derivative of the NPV with
respect to the interest rate (10,000 times this derivative is the
PVBP or DV01). In this package, irr.solve
is primarily
intended to be called by the irr
and
bond.yield
functions. It is made available for those
who want to find IRR of more complex instruments.
1 2 3 4 5 6 7 8 9 |
f |
The function whose zero is to be found. An R function object that takes one numeric argument and returns a list of two components (value and gradient). In the IRR applications, these two components will be the NPV and its derivative |
interval |
The interval c(lower, upper) within which to search for the IRR |
r.guess |
The starting value (guess) from which the solver starts searching for the IRR |
toler |
The argument |
convergence |
The argument |
max.iter |
The maximum number of iterations of the Newton-Raphson procedure |
method |
The root finding method to be used. The
|
The function irr.solve
is basically an interface to the
general root finder newton.raphson.root
. However, if
newton.raphson.root
fails, irr.solve
makes an
attempt to find the root using uniroot
from the R
stats package. Uniroot
uses bisection and it requires the root to
be bracketed (the function must be of opposite sign at the two end
points - lower and upper).
The function irr.solve
returns NA
if the IRR/YTM
could not be found. Otherwise it returns the IRR/YTM. When
NA
is returned, a warning message is printed
Prof. Jayanth R. Varma jrvarma@iima.ac.in
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.