Discount Factor Calculation: disagreement between QuantLib and Bloomberg?

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

Discount Factor Calculation: disagreement between QuantLib and Bloomberg?

Alessio Benavoli
Dear  All,

I have noticed a disagreement between QuantLib and Bloomberg
that seems to be due to the way the ending date of a FRA is computed.

I'm using the following market data
Today: 30 Sept 2013
Fixing: 2 Days
Calendar: TARGET,
Rule: adj:modifiedfollowing
DayCount: Act/360
Depo1m Quote: 0.0034567
Fra1x7m Quote: 0.0036

My goal is to compute Discount Factors.
Depo1m starts 2 Oct 2013 and ends to 4 Nov. 2013 (because of weekend).
Fra1x7m should also start on 4 Nov. 2013, but I'm not sure which  ending
date should be used:
a) 2 May 2014 that is 7 months after 2 Oct 2013;
b) or 5 May 2014 that is 6 months after  4 Nov. 201.

If I use rule (a), then DF(2 May 2014)=0.997897 which coincides with the value that I have downloaded from Blomberg relative to the above market data.
If instead I use (b) then DF(5 May 2014)=0.997867, which is
the value that I obtain using QUANTLIB. 

Which is the correct one (a) or (b) ? Is it possible that  Blomberg and Quantlib disagree on this point?

Thank you for the help.

Best,
Alessio Benavoli
 


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Discount Factor Calculation: disagreement between QuantLib and Bloomberg?

Piter Dias-4
Alessio,

QuantLib is there to help you implementing valuation models that fits your needs. In this sense, matching or not Bloomberg is not exactly a feature, but a matter of proper setup.

I tell this because here in Brazil, sometimes Bloomberg has to catch-up the market (what they eventually do, product by product) but custom libraries like QuantLib may do the job.

Why don't you send a code snippet so we can help? IMHO, what you want is some help to match Bloomberg DFs, right?

Regards,


_____________________
Piter Dias




From: [hidden email]
Date: Sun, 19 Jan 2014 18:21:00 +0100
To: [hidden email]
Subject: [Quantlib-users] Discount Factor Calculation: disagreement between QuantLib and Bloomberg?

Dear  All,

I have noticed a disagreement between QuantLib and Bloomberg
that seems to be due to the way the ending date of a FRA is computed.

I'm using the following market data
Today: 30 Sept 2013
Fixing: 2 Days
Calendar: TARGET,
Rule: adj:modifiedfollowing
DayCount: Act/360
Depo1m Quote: 0.0034567
Fra1x7m Quote: 0.0036

My goal is to compute Discount Factors.
Depo1m starts 2 Oct 2013 and ends to 4 Nov. 2013 (because of weekend).
Fra1x7m should also start on 4 Nov. 2013, but I'm not sure which  ending
date should be used:
a) 2 May 2014 that is 7 months after 2 Oct 2013;
b) or 5 May 2014 that is 6 months after  4 Nov. 201.

If I use rule (a), then DF(2 May 2014)=0.997897 which coincides with the value that I have downloaded from Blomberg relative to the above market data.
If instead I use (b) then DF(5 May 2014)=0.997867, which is
the value that I obtain using QUANTLIB. 

Which is the correct one (a) or (b) ? Is it possible that  Blomberg and Quantlib disagree on this point?

Thank you for the help.

Best,
Alessio Benavoli
 


------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Discount Factor Calculation: disagreement between QuantLib and Bloomberg?

Alessio Benavoli
Dear Piter,

Thank you for the reply. 
My question is more about how to calculate the end date of the FRA1x7m, should I use method (a) or (b) in this case?

I have attached the code.
Output:
Today: Monday, September 30th, 2013
Settlement date: Wednesday, October 2nd, 2013
May 2nd, 2014 DF=0.997906
May 5th, 2014 DF=0.997867

From Bloomberg I get DF=0.997897 associated to Fra1x7m.

Alessio




On Sun, Jan 19, 2014 at 10:18 PM, Piter Dias <[hidden email]> wrote:
Alessio,

QuantLib is there to help you implementing valuation models that fits your needs. In this sense, matching or not Bloomberg is not exactly a feature, but a matter of proper setup.

I tell this because here in Brazil, sometimes Bloomberg has to catch-up the market (what they eventually do, product by product) but custom libraries like QuantLib may do the job.

Why don't you send a code snippet so we can help? IMHO, what you want is some help to match Bloomberg DFs, right?

Regards,


_____________________
Piter Dias




From: [hidden email]
Date: Sun, 19 Jan 2014 18:21:00 +0100
To: [hidden email]
Subject: [Quantlib-users] Discount Factor Calculation: disagreement between QuantLib and Bloomberg?


Dear  All,

I have noticed a disagreement between QuantLib and Bloomberg
that seems to be due to the way the ending date of a FRA is computed.

I'm using the following market data
Today: 30 Sept 2013
Fixing: 2 Days
Calendar: TARGET,
Rule: adj:modifiedfollowing
DayCount: Act/360
Depo1m Quote: 0.0034567
Fra1x7m Quote: 0.0036

My goal is to compute Discount Factors.
Depo1m starts 2 Oct 2013 and ends to 4 Nov. 2013 (because of weekend).
Fra1x7m should also start on 4 Nov. 2013, but I'm not sure which  ending
date should be used:
a) 2 May 2014 that is 7 months after 2 Oct 2013;
b) or 5 May 2014 that is 6 months after  4 Nov. 201.

If I use rule (a), then DF(2 May 2014)=0.997897 which coincides with the value that I have downloaded from Blomberg relative to the above market data.
If instead I use (b) then DF(5 May 2014)=0.997867, which is
the value that I obtain using QUANTLIB. 

Which is the correct one (a) or (b) ? Is it possible that  Blomberg and Quantlib disagree on this point?

Thank you for the help.

Best,
Alessio Benavoli
 


------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

prova.cpp (27K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Discount Factor Calculation: disagreement between QuantLib and Bloomberg?

Peter Caspers-4
Hi Alessio, Piter,

I think there is no conflict. The FRA has its maturity on 02-May-2014,
i.e. this is the end of its accrual period. The underlying Euribor 6M
index's estimation period end date on the other hand is 05-May-2014.
This is because the index estimation period is build from its value
date (04-Nov-13), plus 6m gives 04-May-2014 (Sunday) => adjusted to
05-May-2014, while the FRA schedule is constructed from spot
(02-Oct-13), the end date then being spot+7m = 02-May-2014 (Friday).

For FRAs QL always takes the index estimation period end date as a
pillar in the rate curve, which may be later than the instrument's
maturity date in general. In Murex for example you have the choice if
you want the "last flow" date as a pillar in your curve or the "last
discount" date (in both cases the index estimation period is the same,
therefore the setting "last flow date" requires calibrating more than
one pillar at the same time). "last discount" is what QL is doing. As
a side note, for swaps, if you compile with QL_USE_INDEXED_COUPON it
is similar to the FRA case described before. Without this option the
index estimation periods are set equal to the accrual periods, as an
approximation.

You could argue that if the index estimation period end date is not
equal to the payment date, one should apply a timing adjustment, but
this is usually ignored because it is really really small.

I do not know what BBG does exactly. However using your market data in
QL with loglinear in discount interpolation and 2 settlement days for
the TS, my discount factors are

02.05.2014 0.997897027303 => this matches your BBG figure !
05.05.2014 0.99786711805

Hope that helps.
Peter


On 20 January 2014 09:03, Alessio Benavoli <[hidden email]> wrote:

> Dear Piter,
>
> Thank you for the reply.
> My question is more about how to calculate the end date of the FRA1x7m,
> should I use method (a) or (b) in this case?
>
> I have attached the code.
> Output:
> Today: Monday, September 30th, 2013
> Settlement date: Wednesday, October 2nd, 2013
> May 2nd, 2014 DF=0.997906
> May 5th, 2014 DF=0.997867
>
> From Bloomberg I get DF=0.997897 associated to Fra1x7m.
>
> Alessio
>
>
>
>
> On Sun, Jan 19, 2014 at 10:18 PM, Piter Dias <[hidden email]>
> wrote:
>>
>> Alessio,
>>
>> QuantLib is there to help you implementing valuation models that fits your
>> needs. In this sense, matching or not Bloomberg is not exactly a feature,
>> but a matter of proper setup.
>>
>> I tell this because here in Brazil, sometimes Bloomberg has to catch-up
>> the market (what they eventually do, product by product) but custom
>> libraries like QuantLib may do the job.
>>
>> Why don't you send a code snippet so we can help? IMHO, what you want is
>> some help to match Bloomberg DFs, right?
>>
>> Regards,
>>
>>
>> _____________________
>> Piter Dias
>> [hidden email]
>> www.piterdias.com
>>
>>
>>
>> ________________________________
>> From: [hidden email]
>> Date: Sun, 19 Jan 2014 18:21:00 +0100
>> To: [hidden email]
>> Subject: [Quantlib-users] Discount Factor Calculation: disagreement
>> between QuantLib and Bloomberg?
>>
>>
>> Dear  All,
>>
>> I have noticed a disagreement between QuantLib and Bloomberg
>> that seems to be due to the way the ending date of a FRA is computed.
>>
>> I'm using the following market data
>> Today: 30 Sept 2013
>> Fixing: 2 Days
>> Calendar: TARGET,
>> Rule: adj:modifiedfollowing
>> DayCount: Act/360
>> Depo1m Quote: 0.0034567
>> Fra1x7m Quote: 0.0036
>>
>> My goal is to compute Discount Factors.
>> Depo1m starts 2 Oct 2013 and ends to 4 Nov. 2013 (because of weekend).
>> Fra1x7m should also start on 4 Nov. 2013, but I'm not sure which  ending
>> date should be used:
>> a) 2 May 2014 that is 7 months after 2 Oct 2013;
>> b) or 5 May 2014 that is 6 months after  4 Nov. 201.
>>
>> If I use rule (a), then DF(2 May 2014)=0.997897 which coincides with the
>> value that I have downloaded from Blomberg relative to the above market
>> data.
>> If instead I use (b) then DF(5 May 2014)=0.997867, which is
>> the value that I obtain using QUANTLIB.
>>
>> Which is the correct one (a) or (b) ? Is it possible that  Blomberg and
>> Quantlib disagree on this point?
>>
>> Thank you for the help.
>>
>> Best,
>> Alessio Benavoli
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More
>> Businesses Are Choosing CenturyLink Cloud For Critical Workloads,
>> Development Environments & Everything In Between. Get a Quote or Start a
>> Free Trial Today.
>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>> _______________________________________________ QuantLib-users mailing
>> list [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Discount Factor Calculation: disagreement between QuantLib and Bloomberg?

Alessio Benavoli
Dear Peter,

Thank you for the answer. Now it is clear.

Alessio

---------- Forwarded message ----------
From: Peter Caspers <[hidden email]>
Date: Mon, Jan 20, 2014 at 2:15 PM
Subject: Re: [Quantlib-users] Discount Factor Calculation: disagreement between QuantLib and Bloomberg?
To: Alessio Benavoli <[hidden email]>
Cc: Piter Dias <[hidden email]>, "[hidden email]" <[hidden email]>


Hi Alessio, Piter,

I think there is no conflict. The FRA has its maturity on 02-May-2014,
i.e. this is the end of its accrual period. The underlying Euribor 6M
index's estimation period end date on the other hand is 05-May-2014.
This is because the index estimation period is build from its value
date (04-Nov-13), plus 6m gives 04-May-2014 (Sunday) => adjusted to
05-May-2014, while the FRA schedule is constructed from spot
(02-Oct-13), the end date then being spot+7m = 02-May-2014 (Friday).

For FRAs QL always takes the index estimation period end date as a
pillar in the rate curve, which may be later than the instrument's
maturity date in general. In Murex for example you have the choice if
you want the "last flow" date as a pillar in your curve or the "last
discount" date (in both cases the index estimation period is the same,
therefore the setting "last flow date" requires calibrating more than
one pillar at the same time). "last discount" is what QL is doing. As
a side note, for swaps, if you compile with QL_USE_INDEXED_COUPON it
is similar to the FRA case described before. Without this option the
index estimation periods are set equal to the accrual periods, as an
approximation.

You could argue that if the index estimation period end date is not
equal to the payment date, one should apply a timing adjustment, but
this is usually ignored because it is really really small.

I do not know what BBG does exactly. However using your market data in
QL with loglinear in discount interpolation and 2 settlement days for
the TS, my discount factors are

02.05.2014 0.997897027303 => this matches your BBG figure !
05.05.2014 0.99786711805

Hope that helps.
Peter


On 20 January 2014 09:03, Alessio Benavoli <[hidden email]> wrote:
> Dear Piter,
>
> Thank you for the reply.
> My question is more about how to calculate the end date of the FRA1x7m,
> should I use method (a) or (b) in this case?
>
> I have attached the code.
> Output:
> Today: Monday, September 30th, 2013
> Settlement date: Wednesday, October 2nd, 2013
> May 2nd, 2014 DF=0.997906
> May 5th, 2014 DF=0.997867
>
> From Bloomberg I get DF=0.997897 associated to Fra1x7m.
>
> Alessio
>
>
>
>
> On Sun, Jan 19, 2014 at 10:18 PM, Piter Dias <[hidden email]>
> wrote:
>>
>> Alessio,
>>
>> QuantLib is there to help you implementing valuation models that fits your
>> needs. In this sense, matching or not Bloomberg is not exactly a feature,
>> but a matter of proper setup.
>>
>> I tell this because here in Brazil, sometimes Bloomberg has to catch-up
>> the market (what they eventually do, product by product) but custom
>> libraries like QuantLib may do the job.
>>
>> Why don't you send a code snippet so we can help? IMHO, what you want is
>> some help to match Bloomberg DFs, right?
>>
>> Regards,
>>
>>
>> _____________________
>> Piter Dias
>> [hidden email]
>> www.piterdias.com
>>
>>
>>
>> ________________________________
>> From: [hidden email]
>> Date: Sun, 19 Jan 2014 18:21:00 +0100
>> To: [hidden email]
>> Subject: [Quantlib-users] Discount Factor Calculation: disagreement
>> between QuantLib and Bloomberg?
>>
>>
>> Dear  All,
>>
>> I have noticed a disagreement between QuantLib and Bloomberg
>> that seems to be due to the way the ending date of a FRA is computed.
>>
>> I'm using the following market data
>> Today: 30 Sept 2013
>> Fixing: 2 Days
>> Calendar: TARGET,
>> Rule: adj:modifiedfollowing
>> DayCount: Act/360
>> Depo1m Quote: 0.0034567
>> Fra1x7m Quote: 0.0036
>>
>> My goal is to compute Discount Factors.
>> Depo1m starts 2 Oct 2013 and ends to 4 Nov. 2013 (because of weekend).
>> Fra1x7m should also start on 4 Nov. 2013, but I'm not sure which  ending
>> date should be used:
>> a) 2 May 2014 that is 7 months after 2 Oct 2013;
>> b) or 5 May 2014 that is 6 months after  4 Nov. 201.
>>
>> If I use rule (a), then DF(2 May 2014)=0.997897 which coincides with the
>> value that I have downloaded from Blomberg relative to the above market
>> data.
>> If instead I use (b) then DF(5 May 2014)=0.997867, which is
>> the value that I obtain using QUANTLIB.
>>
>> Which is the correct one (a) or (b) ? Is it possible that  Blomberg and
>> Quantlib disagree on this point?
>>
>> Thank you for the help.
>>
>> Best,
>> Alessio Benavoli
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More
>> Businesses Are Choosing CenturyLink Cloud For Critical Workloads,
>> Development Environments & Everything In Between. Get a Quote or Start a
>> Free Trial Today.
>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>> _______________________________________________ QuantLib-users mailing
>> list [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users