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

1 回表示 (過去 30 日間)
Weijun
Weijun 2012 年 1 月 24 日
回答済み: condor 2014 年 9 月 29 日
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!

回答 (1 件)

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

カテゴリ

Help Center および File ExchangeMATLAB Functions in Microsoft Excel についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by