Why Matlab's IRR (internal rate of return) is much slower than Excel's
1 次查看(过去 30 天)
显示 更早的评论
I am converting a financial cash flow model from Excel VBA to matlab. My code is much faster after vectorization, however to my surprise, my matlab code spent most of its time computing the internal rate of return (IRR) of a set of cash flows. (Let's say I have a 10000 x 36 matrix) containing 10000 iteration of cash flow of 36 month. VBA IRR or Excel's spreadsheet function IRR spends about 1 second finding 10000 IRRs (I believe it doing some kind of goal seek.) However, it takes Matlab 14'' to do that. I also try to write my own Matlab IRR function using fzero and loop through 10000 cash flows, but it's on the same scale of time in computing if not slower.
So I am wondering how Excel can do it so fast? Is there a better way to compute IRR in Matlab?
Thanks!
0 个评论
回答(1 个)
condor
2014-9-29
I have the same problem ... Matlab is soooo slow in computing the irr! Is there any other faster option?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Functions in Microsoft Excel 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!