irrFind
Find IRR (Internal Rate of Return)
Contents
Syntax
- r=irrFind(cashFlowVec, x0, timeUnit4cashFlow, timeUnit4compounding)
Description
r=irrFind(cashFlowVec, x0, timeUnit4cashFlow, timeUnit4compounding) returns the IRR of a given investment plan
- irr: Internal rate of return
- cashFlowVec: Cash flow vector
- x0: Initial guess of IRR, default to 0
- timeUnit4cashFlow: Unit in month for cash flow, with the following possible values:
- 1: month
- 3: quarter
- 6: half year
- 12: year (default)
- timeUnit4compounding: Time unit compounding, with the following possible values:
- 'month' (default) for monthly compounding
- 'year' for yearly compounding (which is a valid option only when timeUnit4cashFlow is 12)
Note that if timeUnit4cashFlow is not 12 and timeUnit4compounding is 'year', the function should return nan.