Question on convertible bond (with discretesdividends)

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Question on convertible bond (with discretesdividends)

benoit houzelle
--> sorry for the fist unreadable mail ....
 
Hello
 
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
 
It is not better to add back in the grid the NPV of dividends ?
like in the hull book chapter 18.3 (5th edition)
 
Regards
Benoît
 
In pricingengines/hybrid/binomialconvertibleengine.hpp
-->the grid will be computed with spot - sum{ NPV(dividends) }
 
// subtract dividends Size i;
for (i=0; i date() >= referenceDate) s0 -= arguments_.dividends[i]->amount() * process_->riskFreeRate()->discount( arguments_.dividends[i]->date()); }
 
 
In pricingengines/hybrid/discretizedconvertible.cpp in the grid we add just dividend
 
Disposable DiscretizedConvertible::adjustedGrid() const { Time t = time(); Array grid = method()->grid(t);
// add back all dividend amounts in the future
for (Size i=0; i = t || close(dividendTime,t))
{ const boost::shared_ptr & d = arguments_.dividends[i];
for (Size j=0; j amount(grid[j]); } }
return grid;
 
 


------------------------------------------------------------------------------
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
Reply | Threaded
Open this post in threaded view
|

Re: Question on convertible bond (with discretesdividends)

Luigi Ballabio
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
Reply | Threaded
Open this post in threaded view
|

Re: Question on convertible bond (with discretesdividends)

benoit houzelle
In reply to this post by benoit houzelle
Thanks for your reply
 
But my problem is on stock grid not on the convertible bond grid 
 
To have an example :
 
add a display in the void DiscretizedConvertible::applyConvertibility() 
to see what is the first node of the grid (for american exercise) :
 
void DiscretizedConvertible::applyConvertibility() {
Array grid = adjustedGrid();
for (Size j=0; j<values_.size(); j++) {
if (values_.size()==1) {
std::ofstream fichier("C:/TEST.txt", std::ios::out | std::ios::app );
fichier << grid[j] << " " ;
fichier << std::endl;
fichier.close();
}
Real payoff = arguments_.conversionRatio*grid[j];
if (values_[j] <= payoff) {
values_[j] = payoff;
conversionProbability_[j] = 1.0;
}
}
}
 
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...)
 
So the stock grid taken into account for convertible bond price computation at each node is not the real stock grid? or I miss something ?
 
Best regards,


--- En date de : Mer 2.12.09, Luigi Ballabio <[hidden email]> a écrit :

De: Luigi Ballabio <[hidden email]>
Objet: Re: [Quantlib-users] Question on convertible bond (with discretesdividends)
À: "benoit houzelle" <[hidden email]>
Cc: [hidden email]
Date: Mercredi 2 Décembre 2009, 12h00

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

CB.xls (21K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Question on convertible bond (with discretesdividends)

Luigi Ballabio
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
Reply | Threaded
Open this post in threaded view
|

Re: Question on convertible bond (with discretesdividends)

benoit houzelle
In reply to this post by benoit houzelle

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?
 
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.
 
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)
The Goldman Sachs model could have problem like in a 2007 email
http://osdir.com/ml/finance.quantlib.user/2007/msg00490.html
Tsiveriotis-Fernandes Model have not this problem.
 
Regards,
 
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

before_Modification.jpg (51K) Download Attachment
after_Modification.jpg (50K) Download Attachment
discretizedconvertible.cpp (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Question on convertible bond (with discretesdividends)

Luigi Ballabio
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
Reply | Threaded
Open this post in threaded view
|

Re: Question on convertible bond (with discretesdividends)

Luigi Ballabio
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
Reply | Threaded
Open this post in threaded view
|

Re: Question on convertible bond (with discretesdividends)

benoit houzelle
In reply to this post by benoit houzelle
Sorry in the last code the discount was computed in the loop ... Delicta juventutis meæ 
if the discount is computed out of the loop the computation time is roughly the same
 
I don't know what you call a patch so I send you the cpp file
 
Regards,
 
 

--- En date de : Jeu 10.12.09, Luigi Ballabio <[hidden email]> a écrit :

De: Luigi Ballabio <[hidden email]>
Objet: Re: [Quantlib-users] Question on convertible bond (with discretesdividends)
À: "benoit houzelle" <[hidden email]>
Cc: [hidden email], [hidden email]
Date: Jeudi 10 Décembre 2009, 17h03

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

after_Modification.jpg (52K) Download Attachment
discretizedconvertible.cpp (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Question on convertible bond (with discretesdividends)

Luigi Ballabio
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