irr | R Documentation |
irr
)Function computing the internal rate of return of a series of cash flows.
irr(object, method = "compound", period = "Y", convention = "30E360E",
isPercentage=TRUE, ...)
object |
a timeSeries object representing cash flows. |
... |
additional arguments passed on to |
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). |
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.
The internal rate of return calculated from the cash flows.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.