Re: VanillaSwap evaluation between effective andtermination date

Posted by YuHong-4 on
URL: http://quantlib.414.s1.nabble.com/VanillaSwap-evaluation-between-effective-and-termination-date-tp383p394.html


I further modify your test program to only first table first line "depo-swap", and one QL_REQUIRE() after the line.  And I find that "fairRate" and "s5yQuote" are both of value 4.43%, so their absolute difference is almost 0 and thus less than 1e-8, hence nothing thrown.  Is such no mispricing result what you expected?  

Output of modified test program:
Today: Monday, September 20th, 2004
Settlement date: Wednesday, September 22nd, 2004
====================================================================
5-year market swap-rate = 4.43 %
====================================================================
        5-years swap paying 4.00 %
term structure | net present value | fair spread | fair fixed rate |
--------------------------------------------------------------------
     depo-swap |          19065.88 |     -0.42 % |          4.43 % |
fairRate : 0.0443000000
s5yQuote : 0.0443000000
|fairRate-s5yQuote| : 0.0000000000

Regards,

Hong Yu




From: [hidden email]
To: [hidden email]
CC: [hidden email]
Date: Tue, 21 Jun 2011 16:14:26 +0200
Subject: RE: [Quantlib-users] VanillaSwap evaluation between effective andtermination date

It should behave the same. To further simplify, just take out those forward schedules and swaps based on them.

 

jicun

 

From: Hong Yu [mailto:[hidden email]]
Sent: den 21 juni 2011 16:10
To: Jicun Zhong
Cc: [hidden email]; Yu Hong
Subject: Re: [Quantlib-users] VanillaSwap evaluation between effective andtermination date

 

 

If it be platform-independent, I am still interested in tracing it on Linux with trunk source.  Also, would you think your example can be further simplified, e.g. from 4 tables to 2 tables or 1 table, and still can reproduce?  Thanks.

 

Regards,

 

Hong Yu

 

 

 

Sent: Tuesday, June 21, 2011 9:21 PM

Subject: RE: [Quantlib-users] VanillaSwap evaluation between effective andtermination date

 

Oh, yes, you need to capture C++ exceptions to see the problem. My environment is VS2008 x64 debug. QuantLib is 1.1 and compiled via VS2008.

If you do not capture the C++ exceptions in the VS, then all QL_REQUIRE will just slip away quitely without detection. The reason you see 4 tables normally calculated is because C++ exceptions are not caught and the result of startDiscount calculation in the DiscountingSwapEngine::calculate()  is not used any where. So everything seems to be normal. So this leads to my original question, why do we need to calculate startDiscount in the first place. This startDiscount calcualtion will kill the valuation situation I mentioned at least theoretically. I guess QuantLib have a few such gray/black areas whose reason to exist is faded through history.

 

Jicun

 

 

From: Hong Yu [mailto:[hidden email]]
Sent: den 21 juni 2011 14:43
To: Jicun Zhong
Cc: Yu Hong
Subject: Re: [Quantlib-users] VanillaSwap evaluation between effective andtermination date

 

 

Hello, I have downloaded your attached source, and still I can compile and run with the same 4-table output, including NPV values’ display.  I did such on Ubuntu-Linux-10.04-LTS with the newest QuantLib trunk source.

 

So may I ask about your computing environment?  Linux or Unix or Windows or other operating system?  Which version of QuantLib library you use?  Did you compile QuantLib or install using installer program?  We may again refer to other people in the mailing list for suggestions, if helpful.  Thanks!

 

Regards,

 

Hong Yu

 


------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users