Displaying 2 results from an estimated 2 matches for "cfdate".
Did you mean:
cdate
2010 Aug 25
4
Secant Method Convergence (Method to replicate Excel XIRR/IRR)
...al guess is very close to the correct IRR.
Maybe I have some basic errors in my coding/logic? Any help would be greatly appreciated.
The Wikipedia article to secant method and IRR: http://en.wikipedia.org/wiki/Internal_rate_of_return#Numerical_solution
Thanks!
ANXIRR <- function (cashFlow, cfDate, guess){
cfDate<-as.Date(cfDate,format="%m/%d/%Y")
irrprev <- c(0); irr<- guess
pvPrev<- sum(cashFlow)
pv<- sum(cashFlow/((1+irr)^(as.numeric(difftime(cfDate,"2010-08-24",units="days"))/360)))
print(pv)
p...
2010 Sep 01
1
Writing My Own Function to Use With aggregate
...C 70 3/1/2003
A C 50 2/1/2004
A C 70 3/1/2005
And an IRR function which takes in a cash flow and dates as inputs: IRR(NCF,cfDate) and returns the IRR
I tried the following:
aggregate(DS01$NCF,by=list(DS01$ FirstName,DS01$ LastName),RR,cfDate=DS01$Date)
and I got the following error:
Error in aggregate.data.frame(as.data.frame(x), ...) :
arguments must have same length
If anyone could shed some light on what may be causi...