irr: Internal Rate of Return

Description Usage Arguments

View source: R/dcf.R

Description

Computes IRR (Internal Rate of Return) for cash flows with different cash flow and compounding conventions. Cash flows need not be evenly spaced.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
irr(
  cf,
  interval = NULL,
  cf.freq = 1,
  comp.freq = 1,
  cf.t = seq(from = 0, by = 1/cf.freq, along.with = cf),
  r.guess = NULL,
  toler = 1e-06,
  convergence = 1e-08,
  max.iter = 100,
  method = c("default", "newton", "bisection")
)

Arguments

cf

Vector of cash flows

interval

the interval c(lower, upper) within which to search for the IRR

cf.freq

Frequency of annuity payments: 1 for annual, 2 for semi-annual, 12 for monthly.

comp.freq

Frequency of compounding of interest rates: 1 for annual, 2 for semi-annual, 12 for monthly, Inf for continuous compounding.

cf.t

Optional vector of timing (in years) of cash flows. If omitted regular sequence of years is assumed.

r.guess

the starting value (guess) from which the solver starts searching for the IRR

toler

the argument toler for irr.solve. The IRR is regarded as correct if abs(NPV) is less than toler. Otherwise the irr function returns NA

convergence

the argument convergence for irr.solve

max.iter

the argument max.iter for irr.solve

method

The root finding method to be used. The default is to try Newton-Raphson method (newton.raphson.root) and if that fails to try bisection (bisection.root). The other two choices (newton and bisection force only one of the methods to be tried.


jrvFinance documentation built on April 18, 2021, 5:06 p.m.