------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Thu, 2009-11-26 at 10:20 +0000, benoit houzelle wrote:
> I have a question about discretes dividends in the binomial > convertible bond pricing engine It seems that > > The grid is computed with spot - sum{ NPV(dividends) } > After in the backward computation, we add in the grid the > dividends (just dividend not the NPV of dividend) > > --> in the last value of grid (ie grid[0][0]) the value is > spot - Sum(NpV(Div)) + Sum(Div) != Spot No, it doesn't work as that. The dividends are added (non discounted) at the nodes corresponding to their payment date. As we work backwards on the tree, the values at the nodes are discounted during roll-back so that we have spot - Sum(NpV(Div)) + Sum(Npv(Div)) at the first node. Algorithmically, this is different than what Hull does (i.e., add at each node the discounted value of the dividends---note, though, that the value is discounted to the time of each node, not to t=0.) But in the end, it is equivalent. We just discount while combining the nodes rather than beforehand. Luigi -- If I do not want others to quote me, I do not speak. -- Phil Wayne ------------------------------------------------------------------------------ Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by benoit houzelle
------------------------------------------------------------------------------ Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users CB.xls (21K) Download Attachment |
On Wed, 2009-12-02 at 16:20 +0000, benoit houzelle wrote:
> add a display in the void > DiscretizedConvertible::applyConvertibility() > to see what is the first node of the grid (for american exercise) : > > And run the ConvertibleBonds.cpp (quantlib example) the result in the > test file is 37.483 and the spot was 36.00 > > and 37.483 is spot - Sum(NPV(Div) + Sum(DIV) (see excel file simple > exemple without calendar adjustment...) Ok, I see. I was looking in the wrong spot. You're right, dividends are added back in the DiscretizedConvertible::adjustedGrid() method without discounting, so it's most probably a bug. May you add discounting, check that it works as expected, and send a patch? You can do it by using process_->riskFreeRate(); if I'm not mistaken, the dividend amounts should be multiplied by discount(dividendTime)/discount(t), is that correct? Thanks, Luigi -- Things should be made as simple as possible, but no simpler. -- Albert Einstein ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by benoit houzelle
------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users before_Modification.jpg (51K) Download Attachment after_Modification.jpg (50K) Download Attachment discretizedconvertible.cpp (12K) Download Attachment |
On Thu, 2009-12-10 at 15:10 +0000, benoit houzelle wrote:
> Your are right ! so we just change (thanks to Samuel Lerouge) > function > Disposable<Array> DiscretizedConvertible::adjustedGrid() > const > > Now the first spot node is 35.9996 (not 36 because we substact > NPV of dividend without grid adjustement and we add NVP > dividend with grid adjustement) > > To have exactly 36 replace > Time dividendTime = dividendTimes_[i]; > by > Time dividendTime = > process_->riskFreeRate()->dayCounter().yearFraction(arguments_.settlementDate, arguments_.dividendDates[i]); > > The calculation time increases from 1s to 3s with my > configuration, it's why we used just once discount function. > Is the time increase due to the calls to yearFraction(), discount(), or both? What if we precompute dividendTimes_ correctly, i.e., if we put your dividendTime formula in the DiscretizedConvertible constructor (around line 69)? We could also precompute the discounts in some way. Anyway, send me a patch and I'll apply it to the repository. Luigi -- It is always the best policy to tell the truth, unless, of course, you are an exceptionally good liar. -- Jerome K. Jerome ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by benoit houzelle
On Thu, 2009-12-10 at 15:10 +0000, benoit houzelle wrote:
> Ps : for information the model used by Quantlib is not exactly > the > Tsiveriotis-Fernandes, it "seems" to be the Goldman Sachs > Model (it is quite similar, it is exactely the same with a > flat riskfree rate and without credit spread) > I see. We might want to rename it then. Luigi -- The Feynman Problem Solving Algorithm: 1) Write down the problem. 2) Think very hard. 3) Write down the solution. ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by benoit houzelle
------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users after_Modification.jpg (52K) Download Attachment discretizedconvertible.cpp (12K) Download Attachment |
On Thu, 2009-12-10 at 16:55 +0000, benoit houzelle wrote:
> I don't know what you call a patch so I send you the cpp file > That's ok, thanks. Luigi -- A child of five would understand this. Send someone to fetch a child of five. -- Groucho Marx ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |