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

1 visualización (últimos 30 días)
Weijun
Weijun el 24 de En. de 2012
Respondida: condor el 29 de Sept. de 2014
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!

Respuestas (1)

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

Categorías

Más información sobre MATLAB Functions in Microsoft Excel en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by