tag:blogger.com,1999:blog-8015724.post5545441812157683065..comments2010-07-13T00:01:12.180-07:00Comments on Software, Mathematics and Money: Internal Rate of Return(IRR) Using Newton-Raphson in C#Unknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8015724.post-5397473205978902622010-07-13T00:01:12.180-07:002010-07-13T00:01:12.180-07:00Thanks for an interesting post. But as far as I ca...Thanks for an interesting post. But as far as I can tell, there seems to be a mistake in the code, in the calculations of the derivative.<br /> sumOfDerivative += _cashFlows[i]*(i)/Math.Pow((1 + estimatedReturnRate), i);<br />should read<br /> sumOfDerivative += _cashFlows[i]*(i)/Math.Pow((1 + estimatedReturnRate), i+1); <br />(the divisor is power i+1), since (if I remember derivation correctly :-) ), the derivative is<br />f'(r) = -sum__{i=1}^{n} iC_i/(r+1)^(i+1).<br />The practical difference is extremely small, but nice to have correct anyway.Unknownhttps://www.blogger.com/profile/07201833932593168745noreply@blogger.comtag:blogger.com,1999:blog-8015724.post-77963202931967944012008-11-16T22:56:00.000-08:002008-11-16T22:56:00.000-08:00Thank you for posting this. This was really intere...Thank you for posting this. This was really interesting. I was looking all over the place for code that computes the IRR. Unfortunately, Visual Studio's own function can only compute for 20 tries. <BR/><BR/>Is it okay if you give me a copy of the code? I'd like to try this out.Nathan "Cody" Hemlockhttps://www.blogger.com/profile/14695240231327035026noreply@blogger.com