irr: Internal Rate of Return ('irr')

irrR Documentation

Internal Rate of Return (irr)

Description

Function computing the internal rate of return of a series of cash flows.

Usage

irr(object, method = "compound", period = "Y", convention = "30E360E", 
       isPercentage=TRUE, ...)

Arguments

object

a timeSeries object representing cash flows.

...

additional arguments passed on to uniroot.

method

character indicating the type of discounting. Can be one of "continuous", "compound" or "linear".

period

character indicating periods of interest payments. Can be "Y", "M", "W" or "D" for yearly, monthly, weekly or daily interest payments.

convention

character indicating the day count convention.

isPercentage

a logical, indicating if the results is returned as percentage (TRUE) or as fraction (FALSE) (default is TRUE).

Details

Computation of the internal rate of return requires the numerical determination of the zeroes of a polynominal. In general these may be complex. A unique real solution is ensured if the first cash flow is negative and all the following cash flows are non-negative with at least one of them being strictly positive, or the first cash flow is positive and all of the followings are non-positive with at least one of them being strictly negative.

Value

The internal rate of return calculated from the cash flows.

Examples

# timeSeries object
cfs <- timeSeries(data = c(-100, 5, 5, 105), 
                  charvec = c("2014-01-01","2015-01-01","2016-01-01","2017-01-01"))
r <- irr(cfs)

# Bond
b <- bond("2013-12-31", maturity = "5 years", nominal = 50000, 
           coupon = 0.02, couponFreq = "1 years")
irr(b)

# Annuity
ann <- annuity("2013-12-31", nominal = 50000, ir = 0.02, maturity = "5 years")
irr(ann)
          

wbreymann/FEMS documentation built on Dec. 8, 2022, 9:43 a.m.