Re: [Quantlib-users] blackvariancecurve question - used by the LMM code...

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

Re: [Quantlib-users] blackvariancecurve question - used by the LMM code...

Klaus Spanderen
Hi Nando,

you wrote
> BlackVarianceCurve is the wrong class for this task. ...
> If I got it right LmVolatilityModel is the LMM core dynamic. The class
> for caplet variance might be std::vector<Volatility> plus an
> interpolation method, without further constraints.
agreed. In order to allow Luigi to ship 0.3.12 I've send him a three line
patch, which allows - for this release only - to disable the constraint check
in BlackVarianceCurve using an additional parameter in the constructor.
Default is of course to check the constraint. Within the next release I'll
change CapletVarianceCurve towards replicating the interpolation
functionality.

cheers
 Klaus



Reply | Threaded
Open this post in threaded view
|

Re: [Quantlib-users] blackvariancecurve question - used by the LMM code...

Klaus Spanderen
Hi Toyin,

On Thursday 09 March 2006 10:29 am, you wrote:
> One final point, the Schedule object used within the cashflows() function
> of the LMMProcess class... I think that you probably need a
> businessdayconvention of UnAdjusted. Otherwise your first cashflow could be
> slightly too long. This is because if the end date falls on a weekend, it
> will be move onto the newt good business day and thus within the generation
> of the coupon dates, the dates will be attached to this modified date.

The libor forward process inherits the cashflow schedule from the given index
to allow exact pricing of cap(lets) using the lfm process. (see test case
LiborMarketModelTest::testCapletPricing() ) and the cashflow schedule for a
normal cap/floor is generated in the same way (see test-suite/capfloor.cpp).
IMO the cash flow should be rolled over if the end date falls on a weekend
but may be I miss the point here.

cheers
 Klaus



Reply | Threaded
Open this post in threaded view
|

Re: [Quantlib-users] blackvariancecurve question - used by the LMM code...

Toyin Akin
Hi,

Normally if a client wants to price a 6 year swap from spot, 6 years is
added onto the spot date (UnAdjusted) and this date is used as a reference
for computing the period dates.

What is adjusted are the period coupon dates (look at the code within the
Schedule object).

The point is, the period dates are computed as :
Adjust(UnAdjustedSwapEndDate - N*Period).

For the final enddate of the final cashflow, this will be
Adjust(UnAdjustedSwapEndDate).
For the start date of the final cashflow, this will be
Adjust(UnAdjustedSwapEndDate - 1*Period).
etc...

For example, if a client wants to price a 6 year swap from the 17/3/2006,
the unadjusted end date of the swap will be 17/3/2012 (a sunday). When the
cashflows are computed 17/3/2012 is used as a reference date and for example
the last coupon will have dates of (18/12/2011, 18/3/2012).

If the AdjustedSwapEndDate is used in this formula, the dates generated are
completely different and a client will look at this schedule and think, well
my swap start on the 17/3/2006 and lasts for 6 years, but why is almost all
my coupon dates starting and ending on the 18th?

It should be the other way around, almost all the dates should be the 17th,
but with some being the 18th (give or take a few days).

That's why for swap / cap calculations, you specify an unadjusted endate
into the schedule class. But an adjustment is used within the coupon class
itself.

If however you use explicit start and end swap dates and you know that the
enddate is a non-holiday, it doesn't matter what BusinessdayConvention you
use.)

Maybe the code within the test-suite/capfloor.cpp should be changed...
I believe that this is the normal case...

Any thoughts anyone...?

Toyin Akin.


>From: Klaus Spanderen <[hidden email]>
>Reply-To: [hidden email]
>To: "Toyin Akin" <[hidden email]>
>CC: [hidden email]
>Subject: Re: [Quantlib-users] blackvariancecurve question - used by the LMM
>code...
>Date: Thu, 9 Mar 2006 05:39:44 +0100
>
>Hi Toyin,
>
>On Thursday 09 March 2006 10:29 am, you wrote:
> > One final point, the Schedule object used within the cashflows()
>function
> > of the LMMProcess class... I think that you probably need a
> > businessdayconvention of UnAdjusted. Otherwise your first cashflow could
>be
> > slightly too long. This is because if the end date falls on a weekend,
>it
> > will be move onto the newt good business day and thus within the
>generation
> > of the coupon dates, the dates will be attached to this modified date.
>
>The libor forward process inherits the cashflow schedule from the given
>index
>to allow exact pricing of cap(lets) using the lfm process. (see test case
>LiborMarketModelTest::testCapletPricing() ) and the cashflow schedule for a
>normal cap/floor is generated in the same way (see
>test-suite/capfloor.cpp).
>IMO the cash flow should be rolled over if the end date falls on a weekend
>but may be I miss the point here.
>
>cheers
>  Klaus
>




Reply | Threaded
Open this post in threaded view
|

RE: Re: [Quantlib-users] blackvariancecurve question - used by the LMM code...

Toyin Akin
Hi,

An update on this...

What you have is correct because you pass in the unadjusted EndDate to the
Schedule class.
The convention is then used for the coupon periods.

Thus the capfloor test code is fine.

The problem arises if you pass in an adjusted end date to the schedule class
then the problems that I described before appy.

Regards,

Toyin Akin.


>From: "Toyin Akin" <[hidden email]>
>To: [hidden email]
>CC: [hidden email]
>Subject: [Quantlib-dev] Re: [Quantlib-users] blackvariancecurve question -
>used by the LMM code...
>Date: Fri, 10 Mar 2006 03:12:27 +0000
>
>
>Hi,
>
>Normally if a client wants to price a 6 year swap from spot, 6 years is
>added onto the spot date (UnAdjusted) and this date is used as a reference
>for computing the period dates.
>
>What is adjusted are the period coupon dates (look at the code within the
>Schedule object).
>
>The point is, the period dates are computed as :
>Adjust(UnAdjustedSwapEndDate - N*Period).
>
>For the final enddate of the final cashflow, this will be
>Adjust(UnAdjustedSwapEndDate).
>For the start date of the final cashflow, this will be
>Adjust(UnAdjustedSwapEndDate - 1*Period).
>etc...
>
>For example, if a client wants to price a 6 year swap from the 17/3/2006,
>the unadjusted end date of the swap will be 17/3/2012 (a sunday). When the
>cashflows are computed 17/3/2012 is used as a reference date and for
>example the last coupon will have dates of (18/12/2011, 18/3/2012).
>
>If the AdjustedSwapEndDate is used in this formula, the dates generated are
>completely different and a client will look at this schedule and think,
>well my swap start on the 17/3/2006 and lasts for 6 years, but why is
>almost all my coupon dates starting and ending on the 18th?
>
>It should be the other way around, almost all the dates should be the 17th,
>but with some being the 18th (give or take a few days).
>
>That's why for swap / cap calculations, you specify an unadjusted endate
>into the schedule class. But an adjustment is used within the coupon class
>itself.
>
>If however you use explicit start and end swap dates and you know that the
>enddate is a non-holiday, it doesn't matter what BusinessdayConvention you
>use.)
>
>Maybe the code within the test-suite/capfloor.cpp should be changed...
>I believe that this is the normal case...
>
>Any thoughts anyone...?
>
>Toyin Akin.
>
>
>>From: Klaus Spanderen <[hidden email]>
>>Reply-To: [hidden email]
>>To: "Toyin Akin" <[hidden email]>
>>CC: [hidden email]
>>Subject: Re: [Quantlib-users] blackvariancecurve question - used by the
>>LMM code...
>>Date: Thu, 9 Mar 2006 05:39:44 +0100
>>
>>Hi Toyin,
>>
>>On Thursday 09 March 2006 10:29 am, you wrote:
>> > One final point, the Schedule object used within the cashflows()
>>function
>> > of the LMMProcess class... I think that you probably need a
>> > businessdayconvention of UnAdjusted. Otherwise your first cashflow
>>could be
>> > slightly too long. This is because if the end date falls on a weekend,
>>it
>> > will be move onto the newt good business day and thus within the
>>generation
>> > of the coupon dates, the dates will be attached to this modified date.
>>
>>The libor forward process inherits the cashflow schedule from the given
>>index
>>to allow exact pricing of cap(lets) using the lfm process. (see test case
>>LiborMarketModelTest::testCapletPricing() ) and the cashflow schedule for
>>a
>>normal cap/floor is generated in the same way (see
>>test-suite/capfloor.cpp).
>>IMO the cash flow should be rolled over if the end date falls on a weekend
>>but may be I miss the point here.
>>
>>cheers
>>  Klaus
>>
>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by xPML, a groundbreaking scripting language
>that extends applications into web and mobile media. Attend the live
>webcast
>and join the prime developer group breaking into this new coding territory!
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>_______________________________________________
>Quantlib-dev mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/quantlib-dev