Displaying 1 result from an estimated 1 matches for "pvprev".
Did you mean:
pprev
2010 Aug 25
4
Secant Method Convergence (Method to replicate Excel XIRR/IRR)
....
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)
print("Hi")
while (abs(pv) >= 0.001) {
t<-irrprev; irrprev<- irr;
irr<-irr-((irr-t)*pv/(pv-pv...