Yc Issue in Ql

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

Yc Issue in Ql

sumanta
Hi,

I tried to create a flat yc in quantlib using only one point. When I evaluated the curve a some future date I was unable to get the same value. Kindly suggest what can be the issue?
Reply | Threaded
Open this post in threaded view
|

Re: Yc Issue in Ql

Luigi Ballabio
You might have mismatched some parameters. May you show the code you used?

Luigi

On Sun, Mar 31, 2013 at 3:22 PM, sumanta <[hidden email]> wrote:

> Hi,
>
> I tried to create a flat yc in quantlib using only one point. When I
> evaluated the curve a some future date I was unable to get the same value.
> Kindly suggest what can be the issue?
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Bond Cash flow dates

Theologis Chapsalis-2
In reply to this post by sumanta
Deal QL community

I am building a Snippet FixedRateBond object and want to get in one Vector<Date> all the dates of coupon payments for a bond. First I tried the  function const Leg & cashflows (   )   const but that did not help. Then I used the nextCashFlowDate which is pretty good. However could I get ALL the future cash flow dates in one go?

Thanks a lot
Theo
Sni

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Bond Cash flow dates

MikeD
try BondFlowAnalysis, the left most vector is the one you want i think...


On Mon, Apr 1, 2013 at 1:12 PM, Theologis Chapsalis <[hidden email]> wrote:
Deal QL community

I am building a FixedRateBond object and want to get in one Vector<Date> all the dates of coupon payments for a bond. First I tried the  function const Leg & cashflows (   )   const but that did not help. Then I used the nextCashFlowDate which is pretty good. However could I get ALL the future cash flow dates in one go?

Thanks a lot
Theo


------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Bond Cash flow dates

Luigi Ballabio
The BondFlowAnalysis function is only available in QuantLibXL.

In C++, call cashflows() to get a vector of pointers to CashFlow; then
loop over the cashflows and call the date() method on each one.

Luigi


On Mon, Apr 1, 2013 at 8:26 PM, Mike DelMedico <[hidden email]> wrote:

> try BondFlowAnalysis, the left most vector is the one you want i think...
>
>
> On Mon, Apr 1, 2013 at 1:12 PM, Theologis Chapsalis <[hidden email]>
> wrote:
>>
>> Deal QL community
>>
>> I am building a FixedRateBond object and want to get in one Vector<Date>
>> all the dates of coupon payments for a bond. First I tried the  function
>> const Leg & cashflows (   )   const but that did not help. Then I used the
>> nextCashFlowDate which is pretty good. However could I get ALL the future
>> cash flow dates in one go?
>>
>> Thanks a lot
>> Theo
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
>> Rise to greatness in Intel's independent game demo contest.
>> Compete for recognition, cash, and the chance to get your game
>> on Steam. $5K grand prize plus 10 genre and skill prizes.
>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
>
> ------------------------------------------------------------------------------
> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Bond Cash flow dates

theologis.chapsalis

Luigi and Mike, thank you very much for the prompt reply. I tried the
following but get a compile error "Cannot instantiate abstract class
QuantLib::CashFlow".


                 std::vector<boost::shared_ptr<CashFlow>> tempCashFlows;
                 tempCashFlows=FixedRateBonds[i].cashflows(); //FixedRateBonds
is a vector<FixedRateBond>
                 std::vector<boost::shared_ptr<CashFlow>>::iterator it2;
                 for(it2=tempCashFlows.begin();it2!=tempCashFlows.end();++it)
                 {
                         cout<< (*it2)->date();
                 }

What am I doing wrong here?

Many thanks for your help
Theo


|------------>
| From:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Luigi Ballabio <[hidden email]>                                                                                                         |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Mike DelMedico <[hidden email]>                                                                                                         |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Cc:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |QuantLib QuantLib <[hidden email]>                                                                                          |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |01/04/2013 20:44                                                                                                                                  |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: [Quantlib-users] Bond Cash flow dates                                                                                                         |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|





The BondFlowAnalysis function is only available in QuantLibXL.

In C++, call cashflows() to get a vector of pointers to CashFlow; then
loop over the cashflows and call the date() method on each one.

Luigi


On Mon, Apr 1, 2013 at 8:26 PM, Mike DelMedico <[hidden email]>
wrote:
> try BondFlowAnalysis, the left most vector is the one you want i think...
>
>
> On Mon, Apr 1, 2013 at 1:12 PM, Theologis Chapsalis
<[hidden email]>
> wrote:
>>
>> Deal QL community
>>
>> I am building a FixedRateBond object and want to get in one Vector<Date>
>> all the dates of coupon payments for a bond. First I tried the  function
>> const Leg & cashflows (   )   const but that did not help. Then I used
the
>> nextCashFlowDate which is pretty good. However could I get ALL the
future
>> cash flow dates in one go?
>>
>> Thanks a lot
>> Theo
>>
>>
>>
>>
------------------------------------------------------------------------------

>> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
>> Rise to greatness in Intel's independent game demo contest.
>> Compete for recognition, cash, and the chance to get your game
>> on Steam. $5K grand prize plus 10 genre and skill prizes.
>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
>
>
------------------------------------------------------------------------------

> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------

Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users




************************************************************
HSBC Bank plc
Registered Office: 8 Canada Square, London E14 5HQ
Registered in England - Number 14259
Authorised and regulated by the Financial Services Authority
************************************************************

-----------------------------------------
SAVE PAPER - THINK BEFORE YOU PRINT!

This transmission has been issued by a member of the HSBC Group
"HSBC" for the information of the addressee only and should not be
reproduced and/or distributed to any other person. Each page
attached hereto must be read in conjunction with any disclaimer
which forms part of it. Unless otherwise stated, this transmission
is neither an offer nor the solicitation of an offer to sell or
purchase any investment. Its contents are based on information
obtained from sources believed to be reliable but HSBC makes no
representation and accepts no responsibility or liability as to its
completeness or accuracy.

------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete
for recognition, cash, and the chance to get your game on Steam.
$5K grand prize plus 10 genre and skill prizes. Submit your demo
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Bond Cash flow dates

Luigi Ballabio
It looks ok to me.  On what line did you get the error?

On Tue, Apr 2, 2013 at 9:33 AM,  <[hidden email]> wrote:

>
> Luigi and Mike, thank you very much for the prompt reply. I tried the
> following but get a compile error "Cannot instantiate abstract class
> QuantLib::CashFlow".
>
>
>                  std::vector<boost::shared_ptr<CashFlow>> tempCashFlows;
>                  tempCashFlows=FixedRateBonds[i].cashflows(); //FixedRateBonds
> is a vector<FixedRateBond>
>                  std::vector<boost::shared_ptr<CashFlow>>::iterator it2;
>                  for(it2=tempCashFlows.begin();it2!=tempCashFlows.end();++it)
>                  {
>                          cout<< (*it2)->date();
>                  }
>
> What am I doing wrong here?
>
> Many thanks for your help
> Theo
>
>
> |------------>
> | From:      |
> |------------>
>   >--------------------------------------------------------------------------------------------------------------------------------------------------|
>   |Luigi Ballabio <[hidden email]>                                                                                                         |
>   >--------------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | To:        |
> |------------>
>   >--------------------------------------------------------------------------------------------------------------------------------------------------|
>   |Mike DelMedico <[hidden email]>                                                                                                         |
>   >--------------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | Cc:        |
> |------------>
>   >--------------------------------------------------------------------------------------------------------------------------------------------------|
>   |QuantLib QuantLib <[hidden email]>                                                                                          |
>   >--------------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | Date:      |
> |------------>
>   >--------------------------------------------------------------------------------------------------------------------------------------------------|
>   |01/04/2013 20:44                                                                                                                                  |
>   >--------------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | Subject:   |
> |------------>
>   >--------------------------------------------------------------------------------------------------------------------------------------------------|
>   |Re: [Quantlib-users] Bond Cash flow dates                                                                                                         |
>   >--------------------------------------------------------------------------------------------------------------------------------------------------|
>
>
>
>
>
> The BondFlowAnalysis function is only available in QuantLibXL.
>
> In C++, call cashflows() to get a vector of pointers to CashFlow; then
> loop over the cashflows and call the date() method on each one.
>
> Luigi
>
>
> On Mon, Apr 1, 2013 at 8:26 PM, Mike DelMedico <[hidden email]>
> wrote:
>> try BondFlowAnalysis, the left most vector is the one you want i think...
>>
>>
>> On Mon, Apr 1, 2013 at 1:12 PM, Theologis Chapsalis
> <[hidden email]>
>> wrote:
>>>
>>> Deal QL community
>>>
>>> I am building a FixedRateBond object and want to get in one Vector<Date>
>>> all the dates of coupon payments for a bond. First I tried the  function
>>> const Leg & cashflows (   )   const but that did not help. Then I used
> the
>>> nextCashFlowDate which is pretty good. However could I get ALL the
> future
>>> cash flow dates in one go?
>>>
>>> Thanks a lot
>>> Theo
>>>
>>>
>>>
>>>
> ------------------------------------------------------------------------------
>
>>> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
>>> Rise to greatness in Intel's independent game demo contest.
>>> Compete for recognition, cash, and the chance to get your game
>>> on Steam. $5K grand prize plus 10 genre and skill prizes.
>>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>>> _______________________________________________
>>> QuantLib-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>>
>>
>>
> ------------------------------------------------------------------------------
>
>> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
>> Rise to greatness in Intel's independent game demo contest.
>> Compete for recognition, cash, and the chance to get your game
>> on Steam. $5K grand prize plus 10 genre and skill prizes.
>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
> ------------------------------------------------------------------------------
>
> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>
>
>
> ************************************************************
> HSBC Bank plc
> Registered Office: 8 Canada Square, London E14 5HQ
> Registered in England - Number 14259
> Authorised and regulated by the Financial Services Authority
> ************************************************************
>
> -----------------------------------------
> SAVE PAPER - THINK BEFORE YOU PRINT!
>
> This transmission has been issued by a member of the HSBC Group
> "HSBC" for the information of the addressee only and should not be
> reproduced and/or distributed to any other person. Each page
> attached hereto must be read in conjunction with any disclaimer
> which forms part of it. Unless otherwise stated, this transmission
> is neither an offer nor the solicitation of an offer to sell or
> purchase any investment. Its contents are based on information
> obtained from sources believed to be reliable but HSBC makes no
> representation and accepts no responsibility or liability as to its
> completeness or accuracy.

------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete
for recognition, cash, and the chance to get your game on Steam.
$5K grand prize plus 10 genre and skill prizes. Submit your demo
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Bond Cash flow dates

sumanta
In reply to this post by Theologis Chapsalis-2
Hello,

You were right. I passed some wrong parameters due to which the yc was not formed properly. I have fixed it and now it is working fine. Thanks for the help.

However, there is one more issue. I asked one of my college to do some negetive testing on my implementation. What he did was to give some sharp jumps to the input points.  This caused a crashed in the YC. I agree that the sharp jumps that he gave was no logical. How can you suggest why the yc crashed? And is it the responsibility of the user to check the validity of the input points before passing it for yc construction.
Reply | Threaded
Open this post in threaded view
|

Re: Bond Cash flow dates

Luigi Ballabio
Hi,
    I'm not sure what the context was here.  Anyway, it's only a crash
if you don't catch exceptions. If you surround the yield-curve
construction with a try/catch clause, you can get hold of the
exception that was raised and find the reason for the failure.
Something like the following will do:

try {
    // your code here
} catch (std::exception& e) {
        std::cout << e.what() << std::endl;
}

Luigi


On Tue, Apr 2, 2013 at 3:47 PM, sumanta <[hidden email]> wrote:

> Hello,
>
> You were right. I passed some wrong parameters due to which the yc was not
> formed properly. I have fixed it and now it is working fine. Thanks for the
> help.
>
> However, there is one more issue. I asked one of my college to do some
> negetive testing on my implementation. What he did was to give some sharp
> jumps to the input points.  This caused a crashed in the YC. I agree that
> the sharp jumps that he gave was no logical. How can you suggest why the yc
> crashed? And is it the responsibility of the user to check the validity of
> the input points before passing it for yc construction.
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172p14179.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Bond Cash flow dates

sumanta
Hello Luigi,

What I did was I gave a set of quotes to create a YC. The sample quotes are given below.

1 day, 3%
3 day , 3%
8 day, 3%
20 day , 3%
25 day, 3%
30 day , 3%
40 day, 3%
45 day , 3%
This worked fine.

Now I changed it to
1 day, 3%
3 day , 3%
8 day, 3%
20 day , 10%
25 day, 3%
30 day , 3%
40 day, 3%
45 day , 3%

This cause the crash.

Regards,
Sumanta


On Wed, Apr 3, 2013 at 3:12 PM, Luigi Ballabio [via QuantLib] <[hidden email]> wrote:
Hi,
    I'm not sure what the context was here.  Anyway, it's only a crash
if you don't catch exceptions. If you surround the yield-curve
construction with a try/catch clause, you can get hold of the
exception that was raised and find the reason for the failure.
Something like the following will do:

try {
    // your code here
} catch (std::exception& e) {
        std::cout << e.what() << std::endl;
}

Luigi


On Tue, Apr 2, 2013 at 3:47 PM, sumanta <[hidden email]> wrote:

> Hello,
>
> You were right. I passed some wrong parameters due to which the yc was not
> formed properly. I have fixed it and now it is working fine. Thanks for the
> help.
>
> However, there is one more issue. I asked one of my college to do some
> negetive testing on my implementation. What he did was to give some sharp
> jumps to the input points.  This caused a crashed in the YC. I agree that
> the sharp jumps that he gave was no logical. How can you suggest why the yc
> crashed? And is it the responsibility of the user to check the validity of
> the input points before passing it for yc construction.
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172p14179.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



If you reply to this email, your message will be added to the discussion below:
http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172p14182.html
To unsubscribe from Yc Issue in Ql, click here.
NAML



--
Great spirits have always encountered violent opposition from mediocre minds.
Reply | Threaded
Open this post in threaded view
|

Re: Bond Cash flow dates

Luigi Ballabio
Catch the exception as I suggested in my previous post and you'll see
the cause of the error.

On Wed, Apr 3, 2013 at 1:26 PM, sumanta <[hidden email]> wrote:

> Hello Luigi,
>
> What I did was I gave a set of quotes to create a YC. The sample quotes are
> given below.
>
> 1 day, 3%
> 3 day , 3%
> 8 day, 3%
> 20 day , 3%
> 25 day, 3%
> 30 day , 3%
> 40 day, 3%
> 45 day , 3%
> This worked fine.
>
> Now I changed it to
> 1 day, 3%
> 3 day , 3%
> 8 day, 3%
> 20 day , 10%
> 25 day, 3%
> 30 day , 3%
> 40 day, 3%
> 45 day , 3%
>
> This cause the crash.
>
> Regards,
> Sumanta
>
>
> On Wed, Apr 3, 2013 at 3:12 PM, Luigi Ballabio [via QuantLib] <[hidden
> email]> wrote:
>>
>> Hi,
>>     I'm not sure what the context was here.  Anyway, it's only a crash
>> if you don't catch exceptions. If you surround the yield-curve
>> construction with a try/catch clause, you can get hold of the
>> exception that was raised and find the reason for the failure.
>> Something like the following will do:
>>
>> try {
>>     // your code here
>> } catch (std::exception& e) {
>>         std::cout << e.what() << std::endl;
>> }
>>
>> Luigi
>>
>>
>> On Tue, Apr 2, 2013 at 3:47 PM, sumanta <[hidden email]> wrote:
>>
>> > Hello,
>> >
>> > You were right. I passed some wrong parameters due to which the yc was
>> > not
>> > formed properly. I have fixed it and now it is working fine. Thanks for
>> > the
>> > help.
>> >
>> > However, there is one more issue. I asked one of my college to do some
>> > negetive testing on my implementation. What he did was to give some
>> > sharp
>> > jumps to the input points.  This caused a crashed in the YC. I agree
>> > that
>> > the sharp jumps that he gave was no logical. How can you suggest why the
>> > yc
>> > crashed? And is it the responsibility of the user to check the validity
>> > of
>> > the input points before passing it for yc construction.
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> > http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172p14179.html
>> > Sent from the quantlib-users mailing list archive at Nabble.com.
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Minimize network downtime and maximize team effectiveness.
>> > Reduce network management and security costs.Learn how to hire
>> > the most talented Cisco Certified professionals. Visit the
>> > Employer Resources Portal
>> > http://www.cisco.com/web/learning/employer_resources/index.html
>> > _______________________________________________
>> > QuantLib-users mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>>
>> ------------------------------------------------------------------------------
>> Minimize network downtime and maximize team effectiveness.
>> Reduce network management and security costs.Learn how to hire
>> the most talented Cisco Certified professionals. Visit the
>> Employer Resources Portal
>> http://www.cisco.com/web/learning/employer_resources/index.html
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172p14182.html
>> To unsubscribe from Yc Issue in Ql, click here.
>> NAML
>
>
>
>
> --
> Great spirits have always encountered violent opposition from mediocre
> minds.
>
> ________________________________
> View this message in context: Re: Bond Cash flow dates
>
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Bond Cash flow dates

sumanta
Hello Luigi,

It says the "1st iteration: could not bootstrap ". The quantlib curve is unable to interpolate these kind of data.

How do you think these should be handled or fixed? Also I would like to inform you that if the wrong data / big jump is at the last quote, the quantlib is able to interpolate properly.

Regards,
Sumanta



On Thu, Apr 4, 2013 at 2:59 PM, Luigi Ballabio [via QuantLib] <[hidden email]> wrote:
Catch the exception as I suggested in my previous post and you'll see
the cause of the error.

On Wed, Apr 3, 2013 at 1:26 PM, sumanta <[hidden email]> wrote:

> Hello Luigi,
>
> What I did was I gave a set of quotes to create a YC. The sample quotes are
> given below.
>
> 1 day, 3%
> 3 day , 3%
> 8 day, 3%
> 20 day , 3%
> 25 day, 3%
> 30 day , 3%
> 40 day, 3%
> 45 day , 3%
> This worked fine.
>
> Now I changed it to
> 1 day, 3%
> 3 day , 3%
> 8 day, 3%
> 20 day , 10%
> 25 day, 3%
> 30 day , 3%
> 40 day, 3%
> 45 day , 3%
>
> This cause the crash.
>
> Regards,
> Sumanta
>
>
> On Wed, Apr 3, 2013 at 3:12 PM, Luigi Ballabio [via QuantLib] <[hidden

> email]> wrote:
>>
>> Hi,
>>     I'm not sure what the context was here.  Anyway, it's only a crash
>> if you don't catch exceptions. If you surround the yield-curve
>> construction with a try/catch clause, you can get hold of the
>> exception that was raised and find the reason for the failure.
>> Something like the following will do:
>>
>> try {
>>     // your code here
>> } catch (std::exception& e) {
>>         std::cout << e.what() << std::endl;
>> }
>>
>> Luigi
>>
>>
>> On Tue, Apr 2, 2013 at 3:47 PM, sumanta <[hidden email]> wrote:
>>
>> > Hello,
>> >
>> > You were right. I passed some wrong parameters due to which the yc was
>> > not
>> > formed properly. I have fixed it and now it is working fine. Thanks for
>> > the
>> > help.
>> >
>> > However, there is one more issue. I asked one of my college to do some
>> > negetive testing on my implementation. What he did was to give some
>> > sharp
>> > jumps to the input points.  This caused a crashed in the YC. I agree
>> > that
>> > the sharp jumps that he gave was no logical. How can you suggest why the
>> > yc
>> > crashed? And is it the responsibility of the user to check the validity
>> > of
>> > the input points before passing it for yc construction.
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> > http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172p14179.html
>> > Sent from the quantlib-users mailing list archive at Nabble.com.

>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Minimize network downtime and maximize team effectiveness.
>> > Reduce network management and security costs.Learn how to hire
>> > the most talented Cisco Certified professionals. Visit the
>> > Employer Resources Portal
>> > http://www.cisco.com/web/learning/employer_resources/index.html
>> > _______________________________________________
>> > QuantLib-users mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>>
>> ------------------------------------------------------------------------------
>> Minimize network downtime and maximize team effectiveness.
>> Reduce network management and security costs.Learn how to hire
>> the most talented Cisco Certified professionals. Visit the
>> Employer Resources Portal
>> http://www.cisco.com/web/learning/employer_resources/index.html
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172p14182.html
>> To unsubscribe from Yc Issue in Ql, click here.
>> NAML
>
>
>
>
> --
> Great spirits have always encountered violent opposition from mediocre
> minds.
>
> ________________________________
> View this message in context: Re: Bond Cash flow dates
>
> Sent from the quantlib-users mailing list archive at Nabble.com.

>
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



If you reply to this email, your message will be added to the discussion below:
http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172p14192.html
To unsubscribe from Yc Issue in Ql, click here.
NAML



--
Great spirits have always encountered violent opposition from mediocre minds.
Reply | Threaded
Open this post in threaded view
|

R: Bond Cash flow dates

Ballabio Gerardo-4

I suppose the problem is that in order to have quoted rates of 10% at 20 days and 3% at 25 days, the yield curve must be strongly negative between 20 and 25 days. From a quick back-of-the-envelope calculation I’d estimate it at -25%. That’s an unreasonable value and I wonder whether QuantLib should actually be required to deal with such values.

Indeed you don’t have this problem if the 10% quote is the last one.

 

Gerardo

 

 

Da: sumanta [mailto:[hidden email]]
Inviato: giovedì 4 aprile 2013 11.49
A: [hidden email]
Oggetto: Re: [Quantlib-users] Bond Cash flow dates

 

Hello Luigi,

It says the "1st iteration: could not bootstrap ". The quantlib curve is unable to interpolate these kind of data.

How do you think these should be handled or fixed? Also I would like to inform you that if the wrong data / big jump is at the last quote, the quantlib is able to interpolate properly.

Regards,

Sumanta

 

 

On Thu, Apr 4, 2013 at 2:59 PM, Luigi Ballabio [via QuantLib] <[hidden email]> wrote:

Catch the exception as I suggested in my previous post and you'll see
the cause of the error.

On Wed, Apr 3, 2013 at 1:26 PM, sumanta <[hidden email]> wrote:


> Hello Luigi,
>
> What I did was I gave a set of quotes to create a YC. The sample quotes are
> given below.
>
> 1 day, 3%
> 3 day , 3%
> 8 day, 3%
> 20 day , 3%
> 25 day, 3%
> 30 day , 3%
> 40 day, 3%
> 45 day , 3%
> This worked fine.
>
> Now I changed it to
> 1 day, 3%
> 3 day , 3%
> 8 day, 3%
> 20 day , 10%
> 25 day, 3%
> 30 day , 3%
> 40 day, 3%
> 45 day , 3%
>
> This cause the crash.
>
> Regards,
> Sumanta
>
>

> On Wed, Apr 3, 2013 at 3:12 PM, Luigi Ballabio [via QuantLib] <[hidden


> email]> wrote:
>>
>> Hi,
>>     I'm not sure what the context was here.  Anyway, it's only a crash
>> if you don't catch exceptions. If you surround the yield-curve
>> construction with a try/catch clause, you can get hold of the
>> exception that was raised and find the reason for the failure.
>> Something like the following will do:
>>
>> try {
>>     // your code here
>> } catch (std::exception& e) {
>>         std::cout << e.what() << std::endl;
>> }
>>
>> Luigi
>>
>>
>> On Tue, Apr 2, 2013 at 3:47 PM, sumanta <[hidden email]> wrote:
>>
>> > Hello,
>> >
>> > You were right. I passed some wrong parameters due to which the yc was
>> > not
>> > formed properly. I have fixed it and now it is working fine. Thanks for
>> > the
>> > help.
>> >
>> > However, there is one more issue. I asked one of my college to do some
>> > negetive testing on my implementation. What he did was to give some
>> > sharp
>> > jumps to the input points.  This caused a crashed in the YC. I agree
>> > that
>> > the sharp jumps that he gave was no logical. How can you suggest why the
>> > yc
>> > crashed? And is it the responsibility of the user to check the validity
>> > of
>> > the input points before passing it for yc construction.
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> > http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172p14179.html

>> > Sent from the quantlib-users mailing list archive at Nabble.com.


>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Minimize network downtime and maximize team effectiveness.
>> > Reduce network management and security costs.Learn how to hire
>> > the most talented Cisco Certified professionals. Visit the
>> > Employer Resources Portal
>> > http://www.cisco.com/web/learning/employer_resources/index.html
>> > _______________________________________________
>> > QuantLib-users mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>>
>> ------------------------------------------------------------------------------
>> Minimize network downtime and maximize team effectiveness.
>> Reduce network management and security costs.Learn how to hire
>> the most talented Cisco Certified professionals. Visit the
>> Employer Resources Portal
>> http://www.cisco.com/web/learning/employer_resources/index.html
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172p14182.html
>> To unsubscribe from Yc Issue in Ql, click here.
>> NAML
>
>
>
>
> --
> Great spirits have always encountered violent opposition from mediocre
> minds.
>

> ________________________________

> View this message in context: Re: Bond Cash flow dates
>

> Sent from the quantlib-users mailing list archive at Nabble.com.


>
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


If you reply to this email, your message will be added to the discussion below:

http://quantlib.10058.n7.nabble.com/Yc-Issue-in-Ql-tp14172p14192.html

To unsubscribe from Yc Issue in Ql, click here.
NAML




--
Great spirits have always encountered violent opposition from mediocre minds.

 


View this message in context: Re: Bond Cash flow dates
Sent from the quantlib-users mailing list archive at Nabble.com.




Banca Profilo S.p.A. Corso Italia, 49 - 20122 Milano - Tel. 02 58408.1, Fax 02 5831 6057 Capitale Sociale Euro 136.794.106,00 i.v. Iscrizione al Registro Imprese di Milano, C.F. e P.IVA 09108700155 - [hidden email] Iscritta all’Albo delle Banche e dei Gruppi bancari Aderente al Fondo Interbancario di Tutela dei depositi Aderente al Conciliatore Bancario Finanziario e all’Arbitro Bancario Finanziario Appartenente al Gruppo bancario Banca Profilo e soggetta all’attività di direzione e coordinamento di Arepo BP S.p.A. DISCLAIMER: The information transmitted may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users