Why Matlab's IRR (internal rate of return) is much slower than Excel's

1 view (last 30 days)
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!

Answers (1)

condor
condor on 29 Sep 2014
I have the same problem ... Matlab is soooo slow in computing the irr! Is there any other faster option?

Categories

Find more on MATLAB Functions in Microsoft Excel in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!