ºìÁªLinuxÃÅ»§
Linux°ïÖú

linuxϱàÒë²¢ÅäÖÃquantlib

·¢²¼Ê±¼ä:2008-08-29 16:35:15À´Ô´:ºìÁª×÷Õß:SnEMOrb
quantlibÊÇÒ»¸öC++±àдµÄÃâ·Ñ£¬¿ªÔ´µÄÊýÁ¿½ðÈÚ¿â¡£

ÔÚsourceforge£¨http://sourceforge.net/project/showfiles.php?group_id=12740£©ÉÏÏÂÔØÈí¼þ°üQuantLib£¬Ä¿Ç°µÄ°æ±¾ÊÇ0.9.6

ÏÂÃ濪ʼ°²×°

quantlibÐèÒªboostµÄÖ§³Ö£¬´ó¶àÊýinux·¢ÐаæÒѾ­Ô¤ÏÈ°²×°ÁËboost£¬¾Í²»ÓÃÀÍÉñÁË

$ tar zxvf QuantLib-0.9.6.tar.gz
$ cd QuantLIb-0.9.6
$ ./configure
$ make
$ sudo make install

±àÒëÒª»¨Ò»µãʱ¼ä£¬ÇëÄÍÐĵȴý

Íê³Éºó¿ÉÒÔÔÚ/usr/local/libÏ¿´µ½libQuantLib.aÒÔ¼°libQuantLib.so£¬Õâ·Ö±ðÊÇquantlibµÄ¾²Ì¬¿âºÍ¹²Ïí¿â¡£

ΪÁËÁ´½ÓÕýÈ·¼üÈë export LD_LIBRARY_PATH=/usr/local/lib

ÏÂÃæ½øÐвâÊÔ£¬ÖØнøÈëQuantLib-0.9.6£¬¾ÍÊÇÎÒÃǽâѹµÄĿ¼

ÒýÓÃ:
$ cd Examples

$ cd CDS

$ g++ -c CDS.cpp

$ g++ -o CDS CDS.o -lQuantLib

$ ./CDS

Calibrated hazard rate values:
hazard rate on May 15th, 2007 is 0.0299689
hazard rate on September 20th, 2007 is 0.0299689
hazard rate on December 20th, 2007 is 0.0299613
hazard rate on June 20th, 2008 is 0.0299619
hazard rate on June 22nd, 2009 is 0.0299622

Some survival probability values:
1Y survival probability: 97.040061 %
expected: 97.040000 %
2Y survival probability: 94.175660 %
expected: 94.180000 %

Repricing of quoted CDSs employed for calibration:
3M fair spread: 1.500000 %
NPV: 1.86446e-10
default leg: -5218.16
coupon leg: 5218.16

6M fair spread: 1.500000 %
NPV: -5.09317e-11
default leg: -8882.83
coupon leg: 8882.83

1Y fair spread: 1.500000 %
NPV: -2.15732e-09
default leg: -16142.9
coupon leg: 16142.9

2Y fair spread: 1.500000 %
NPV: -2.91038e-11
default leg: -30271.7
coupon leg: 30271.7

Run completed in 0 s


ÔËÐÐÕý³££¬ÒÔºó±ã¿ÉÒÔÓÃquantlib¿ìËÙ¸ßЧµÄ¿ª·¢ÊýÁ¿½ðÈÚ³ÌÐòÁË¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ