Hi All,
I have to calculate the IRRs of investments containing cash flows at non-regular intervals. It's something like the QuantLib::CashFlows::yield() function, but I need all the potential solutions, as if yield() were called with all potential initial guesses. (I'm going to use custom rules to sort out inappropriate solutions.) I'm new to Quantlib, this is why I don't know if it contains the function that I need. Could anyone please help me with some instructions on how to perform this calculation with Quantlib? Thanks in advance, homay ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi Homay
> I have to calculate the IRRs of investments containing cash flows at non-regular intervals. Not a problem, just wrap them in a std::vector<boost::shared_ptr<CashFlow> > > It's something like the QuantLib::CashFlows::yield() function, but I need > all the potential solutions, as if yield() were called with all potential initial > guesses. (I'm going to use custom rules to sort out inappropriate solutions.) potential solutions ??? there's just one IRR given a stream of positive cashflows, and it does not depend on the initial guess ciao -- Nando ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Dear Nando,
Thank you four your quick answer. Actually, I forgot to mention that the cash flows may contain negative items, too. Thank you for the note that there is exactly one IRR for positive cash flows. It's straightforward but I did not noticed it yet. I considered the following example (a theoretical case for the sake of 'nice' numbers): 2008.Jul. +10000 (initial deposit) 2009.Jan. -10000 (withdraw) 2009.Jul. -10000 (withdraw) 2010.Jan. +10000 (deposit) 2010.Jul. +1000 final value It has three solutions, approx. -98%, -50% and +43%. The first two are wrong solutions _in this case_ according to the (current) used-defined/approved rules (additional knowledge) that must be customizable. This is why I need all potential IRR. - homay 2010.09.29. 9:47, Ferdinando Ametrano wrote: > Hi Homay > >> I have to calculate the IRRs of investments containing cash flows at >>non-regular intervals. > Not a problem, just wrap them in a std::vector<boost::shared_ptr<CashFlow> > > >> It's something like the QuantLib::CashFlows::yield() function, but I need >> all the potential solutions, as if yield() were called with all potential initial >> guesses. (I'm going to use custom rules to sort out inappropriate solutions.) > > potential solutions ??? there's just one IRR given a stream of > positive cashflows, and it does not depend on the initial guess > > ciao -- Nando > ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Wed, 2010-09-29 at 11:43 +0200, [hidden email] wrote:
> Actually, I forgot to mention that the cash flows may contain negative > items, too. > > I considered the following example (a theoretical case for the sake of > 'nice' numbers): > > 2008.Jul. +10000 (initial deposit) > 2009.Jan. -10000 (withdraw) > 2009.Jul. -10000 (withdraw) > 2010.Jan. +10000 (deposit) > 2010.Jul. +1000 final value > > It has three solutions, approx. -98%, -50% and +43%. The first two are > wrong solutions _in this case_ according to the (current) > used-defined/approved rules (additional knowledge) that must be > customizable. > This is why I need all potential IRR. My guess (no pun intended) is that you can try and run CashFlows::yield starting from a number of different guesses spanning your allowed solution range. Depending on where you start, the solver might converge on different solutions. Afterwards, you can prune the invalid ones. Luigi -- There is no likelihood man can ever tap the power of the atom. -- Robert Millikan, Nobel Prize in Physics, 1923 ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |