Hi Noli ------------------------------------------------------------ To: "[email protected]" <[email protected]> Subject: [Help-glpk] IRR (Internal Rate of Return) using MathProg From: Noli Sicad <[email protected]> Date: Sat, 15 Sep 2012 01:26:56 +1000 ------------------------------------------------------------
> I like to incorporate IRR (Internal Rate of Return) in > my report (i.e. Report Section of my LP GLPK/MathProg > model). I don't how to do this using mathprog > > Linux Journal has article in IRR and programs in Java, > C and Perl. You can download the source here. > http://www.linuxjournal.com/article/2545 > > However, I have difficulties deciphering it. > > Some discussions on various methods on how to calculate > IRR. http://finance.thinkanddone.com/irr.html > > My LP model is maximizing Net Present Value > (i.e. revenues / Cash flow). Here is example of the > cash flow (below). I cannot help you with the MathProg code. But I do use discounted cash flow calculations. So here are some observations: IRR is not NPV. You need to get the right formula from wikipedia. It seems to me (but I could be badly mistaken) that NPV is an explicit equation and IRR is implicit. NPV takes the discount rate as parameter, hence no need for numerical methods like Newton-Raphson. You just need NPV then? Once you get your formula working, check it against the appropriate spreadsheet function. In my case, I used: PMT(rate, periods, investment value, future value). That way you will align with the industry conventions. You can sometimes break the formulas up into parts for ease of coding. You will need to decide how to deal with all the corner cases: can the interest rate be zero for instance, do you wish to check, what happens then, and so on .. One reference that I never used, but looked interesting: Ødegaard, Bernt Arne. 2007. Financial numerical recipes in C++ -- April 2007. Software documentation. http://finance.bi.no/~bernt/gcc_prog http://finance.bi.no/~bernt/gcc_prog/recipes/recipes.pdf http://finance.bi.no/~bernt/gcc_prog/recipes/finrecipes.tar.gz Finally, try googling with "GAMS". This must be a common enough task for GAMS users. This one looks related (but care with the download, the filename contains comma chars): Wu, Jinzhuo, Mark Sperow, and Jingxin Wang. 2010. Economic feasibility of a woody biomass-based ethanol plant in central Appalachia. Journal of Agricultural and Resource Economics v35 no3 p522-544. http://purl.umn.edu/99118 http://ageconsearch.umn.edu/bitstream/99118/2/JARE,Dec2010,%2311F,pp522-544.pdf HTH, Robbie --- Robbie Morrison PhD student -- policy-oriented energy system simulation Institute for Energy Engineering (IET) Technical University of Berlin (TU-Berlin), Germany University email (redirected) : [email protected] Webmail (preferred) : [email protected] [from Webmail client] _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
