Are there any R packages available that have some form of function that can calculate IRR based on uneven payments on specific dates for a lump sum distribution.
Example:
df <- data.frame(date = c(as.Date("2010-1-24"), as.Date("2011-5-6"), as.Date("2012-3-24")), pmts=c(-2000,-1000,-800))
today <- as.Date("2012-7-25")
lumpsum <- 4580
I’m looking for an easy way to calculate the rate of return of $4580 received today in exchange for the payment schedule defined above.
Thanks in advance,
–JT
As already noted in the comments it would be easier to write something simple:
gives a IRR of 11.26%
EDIT:
after a quick scout around the
lifecontingenciespackage has a present value function if you want to use that instead.