You can subscribe to this list here.
2000 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}
(17) 

2001 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}
(23) 
2002 
_{Jan}
(18) 
_{Feb}
(20) 
_{Mar}
(22) 
_{Apr}
(41) 
_{May}
(28) 
_{Jun}
(25) 
_{Jul}
(10) 
_{Aug}
(7) 
_{Sep}
(5) 
_{Oct}
(20) 
_{Nov}
(13) 
_{Dec}
(11) 
2003 
_{Jan}
(28) 
_{Feb}
(5) 
_{Mar}
(6) 
_{Apr}
(5) 
_{May}
(17) 
_{Jun}
(6) 
_{Jul}
(45) 
_{Aug}
(35) 
_{Sep}
(24) 
_{Oct}
(50) 
_{Nov}
(53) 
_{Dec}
(6) 
2004 
_{Jan}
(4) 
_{Feb}
(10) 
_{Mar}
(52) 
_{Apr}
(46) 
_{May}
(8) 
_{Jun}
(25) 
_{Jul}
(12) 
_{Aug}
(6) 
_{Sep}
(8) 
_{Oct}
(8) 
_{Nov}
(9) 
_{Dec}
(7) 
2005 
_{Jan}
(18) 
_{Feb}
(60) 
_{Mar}
(19) 
_{Apr}
(26) 
_{May}
(14) 
_{Jun}
(27) 
_{Jul}
(8) 
_{Aug}
(15) 
_{Sep}
(19) 
_{Oct}
(53) 
_{Nov}
(20) 
_{Dec}
(23) 
2006 
_{Jan}
(16) 
_{Feb}
(27) 
_{Mar}
(33) 
_{Apr}
(51) 
_{May}
(36) 
_{Jun}
(25) 
_{Jul}
(54) 
_{Aug}
(30) 
_{Sep}
(25) 
_{Oct}
(67) 
_{Nov}
(43) 
_{Dec}
(13) 
2007 
_{Jan}
(23) 
_{Feb}
(27) 
_{Mar}
(55) 
_{Apr}
(79) 
_{May}
(60) 
_{Jun}
(66) 
_{Jul}
(46) 
_{Aug}
(30) 
_{Sep}
(90) 
_{Oct}
(49) 
_{Nov}
(85) 
_{Dec}
(74) 
2008 
_{Jan}
(68) 
_{Feb}
(59) 
_{Mar}
(64) 
_{Apr}
(28) 
_{May}
(66) 
_{Jun}
(35) 
_{Jul}
(73) 
_{Aug}
(76) 
_{Sep}
(65) 
_{Oct}
(46) 
_{Nov}
(41) 
_{Dec}
(19) 
2009 
_{Jan}
(46) 
_{Feb}
(90) 
_{Mar}
(51) 
_{Apr}
(104) 
_{May}
(13) 
_{Jun}
(24) 
_{Jul}
(20) 
_{Aug}
(39) 
_{Sep}
(109) 
_{Oct}
(101) 
_{Nov}
(117) 
_{Dec}
(57) 
2010 
_{Jan}
(55) 
_{Feb}
(42) 
_{Mar}
(39) 
_{Apr}
(22) 
_{May}
(33) 
_{Jun}
(41) 
_{Jul}
(25) 
_{Aug}
(52) 
_{Sep}
(75) 
_{Oct}
(60) 
_{Nov}
(62) 
_{Dec}
(52) 
2011 
_{Jan}
(70) 
_{Feb}
(31) 
_{Mar}
(26) 
_{Apr}
(28) 
_{May}
(17) 
_{Jun}
(38) 
_{Jul}
(51) 
_{Aug}
(35) 
_{Sep}
(27) 
_{Oct}
(35) 
_{Nov}
(10) 
_{Dec}
(20) 
2012 
_{Jan}
(21) 
_{Feb}
(29) 
_{Mar}
(13) 
_{Apr}
(37) 
_{May}
(33) 
_{Jun}
(12) 
_{Jul}
(34) 
_{Aug}
(27) 
_{Sep}
(29) 
_{Oct}
(35) 
_{Nov}
(58) 
_{Dec}
(27) 
2013 
_{Jan}
(27) 
_{Feb}
(16) 
_{Mar}
(40) 
_{Apr}
(16) 
_{May}
(34) 
_{Jun}
(37) 
_{Jul}
(6) 
_{Aug}
(3) 
_{Sep}
(4) 
_{Oct}
(49) 
_{Nov}
(13) 
_{Dec}
(12) 
2014 
_{Jan}
(15) 
_{Feb}
(21) 
_{Mar}
(11) 
_{Apr}
(13) 
_{May}
(27) 
_{Jun}
(60) 
_{Jul}
(19) 
_{Aug}
(29) 
_{Sep}
(20) 
_{Oct}
(28) 
_{Nov}
(41) 
_{Dec}
(15) 
2015 
_{Jan}
(33) 
_{Feb}
(29) 
_{Mar}
(26) 
_{Apr}
(17) 
_{May}
(2) 
_{Jun}
(13) 
_{Jul}
(21) 
_{Aug}
(30) 
_{Sep}
(22) 
_{Oct}
(15) 
_{Nov}
(41) 
_{Dec}

S  M  T  W  T  F  S 





1
(1) 
2

3
(1) 
4

5
(1) 
6
(1) 
7
(2) 
8

9

10

11
(2) 
12
(3) 
13
(3) 
14

15
(1) 
16
(2) 
17

18

19
(3) 
20

21
(1) 
22

23

24

25
(1) 
26

27

28

29

30
(3) 
31

From: Kim Kuen Tang <kuentang@vo...>  20100730 20:51:04

Hi Patrick, henaffp schrieb: > Hello, > > I can build and run the entire test suite > /usr/local/bin/quantlibtestsuite > > I'm now trying to run a single unit test with > /usr/local/bin/quantlibtestsuite run_test=xxx > test cases in quantlib are registered using free functions instead of arguments. So i am afraid that this is not possible. Take a look at testsuite\utilities.hpp on line 63. It uses BOOST_TEST_CASE instead of BOOST_AUTO_TEST_CASE. A workaround would be u just comment the tests out in file quantlibtestsuite.hpp that you dont want to run. HTH Kim > What should xxx look like? If I take the example of the Quotetest suite > (quotes.cpp), I see that > the suite is named "Quote tests" > > but > /usr/local/bin/quantlibtestsuite run_test="Quotes tests" > does not work, nor many variations on that theme. > > Could anyone indicate how to do this? > > Thanks in advance > > Patrick Hénaff > 
From: Javit Hafizoglu <ch5kd@vi...>  20100730 05:49:49

I updated the generalized Hull White model and performed tests with QL1.0.1. Tests are successful. For some reason calibration takes longer now. In the BermudanSwaption.cpp, I changed the optimization end criteria down to 40 and 10 from 400 and 100 for the max iteration and stationary iterations. This way, it takes shorter to calibrate. I attached the files. The changes:  For some reason, parameter.hpp in QL1.0.1 is not the same as trunk version 17224. The trunk version is the correct one except the line 145 : Parameter(times.size()+1, where the “+1” should go away.  The changes in GHW classes are only at the lines where a PiecewiseConstantParameter class is initiated. The new parameter.hpp accepts constraints at the initialization. I imposed positive constraints for both the a_ and sigma_ parameters in the model. Here are my suggestions:  Update the parameter.hpp in QL1.0.1 as above.  Update the GHW model files with the ones attached.  The BermudanSwaption.cpp test file can be modified as the one I attached to include the GHW test in the testsuite. The BermudanSwaption.cpp output from my laptop is below. I look forward to your comments. Thank you, Javit G2 (analytic formulae) calibration 1x5: model 10.05475 %, market 11.48000 % (1.42525 %) 2x4: model 10.48803 %, market 11.08000 % (0.59197 %) 3x3: model 10.67504 %, market 10.70000 % (0.02496 %) 4x2: model 10.83340 %, market 10.21000 % (+0.62340 %) 5x1: model 10.98264 %, market 10.00000 % (+0.98264 %) calibrated to: a = 0.099851, sigma = 0.010545 b = 0.099851, eta = 0.010545 rho = 0.74998 HullWhite (analytic formulae) calibration 1x5: model 11.87889 %, market 11.48000 % (+0.39889 %) 2x4: model 11.76594 %, market 11.08000 % (+0.68594 %) 3x3: model 11.87495 %, market 10.70000 % (+1.17495 %) 4x2: model 11.88579 %, market 10.21000 % (+1.67579 %) 5x1: model 11.85322 %, market 10.00000 % (+1.85322 %) calibrated to: a = 0.10014, sigma = 0.0076919 HullWhite (numerical) calibration 1x5: model 10.31044 %, market 11.48000 % (1.16956 %) 2x4: model 10.50842 %, market 11.08000 % (0.57158 %) 3x3: model 10.62836 %, market 10.70000 % (0.07164 %) 4x2: model 10.71895 %, market 10.21000 % (+0.50895 %) 5x1: model 10.81202 %, market 10.00000 % (+0.81202 %) calibrated to: a = 0.10014, sigma = 0.006877 BlackKarasinski (numerical) calibration 1x5: model 12.85815 %, market 11.48000 % (+1.37815 %) 2x4: model 13.11871 %, market 11.08000 % (+2.03871 %) 3x3: model 13.25333 %, market 10.70000 % (+2.55333 %) 4x2: model 13.33942 %, market 10.21000 % (+3.12942 %) 5x1: model 13.43137 %, market 10.00000 % (+3.43137 %) calibrated to: a = 0.08249, sigma = 0.1667 Generalized HullWhite calibration 1x5: model 11.16996 %, market 11.48000 % (0.31004 %) 2x4: model 11.15188 %, market 11.08000 % (+0.07188 %) 3x3: model 10.87750 %, market 10.70000 % (+0.17750 %) 4x2: model 10.42011 %, market 10.21000 % (+0.21011 %) 5x1: model 9.78110 %, market 10.00000 % (0.21890 %) parameter[0] =, 0.04 parameter[1] =, 0.37449 parameter[2] =, 0.084144 parameter[3] =, 0.1 parameter[4] =, 0.24785 parameter[5] =, 0.053831 Payer bermudan swaption struck at 5.00000 % (ATM) Generalized HW: 14.515 G2: 14.549 HW: 15.005 HW (num): 13.404 BK: 16.457 Payer bermudan swaption struck at 6.00000 % (OTM) Generalized HW: 3.671 G2: 3.4158 HW: 3.6088 HW (num): 2.6985 BK: 5.6241 Payer bermudan swaption struck at 4.00000 % (ITM) Generalized HW: 42.622 G2: 42.838 HW: 43.154 HW (num): 42.52 BK: 42.998 Run completed in 15 m 31 s Press any key to continue . . . Alexander Lotter wrote: > > > > Javit Hafizoglu wrote: >> >> I'm relocating. Lots of things to do. I'm planning to finish this update >> by the end of June. >> >> > > Hi Javit, > > Great. I could assist you by tests. Just let me know, if you need any > help. > > Take care > > Alex > > http://old.nabble.com/file/p29303026/GHW.rar GHW.rar  View this message in context: http://old.nabble.com/GeneralizedHullWhitemodelproblemstp28647789p29303026.html Sent from the quantlibdev mailing list archive at Nabble.com. 
From: henaffp <patrick.henaff@ke...>  20100730 00:41:11

Hello, I can build and run the entire test suite /usr/local/bin/quantlibtestsuite I'm now trying to run a single unit test with /usr/local/bin/quantlibtestsuite run_test=xxx What should xxx look like? If I take the example of the Quotetest suite (quotes.cpp), I see that the suite is named "Quote tests" but /usr/local/bin/quantlibtestsuite run_test="Quotes tests" does not work, nor many variations on that theme. Could anyone indicate how to do this? Thanks in advance Patrick Hénaff  View this message in context: http://old.nabble.com/unittesttp29301875p29301875.html Sent from the quantlibdev mailing list archive at Nabble.com. 
From: james hirschorn <j_hirschorn@ya...>  20100725 13:44:08

Yes, a Gamma process would be good to have, not just for VG. Maybe the best way to implement VG is to use Brownian motion with a random time change given by the gamma process. I'm not sure of the pros and cons versus taking the difference of two gamma processes, or of approximating VG by a compound Poisson process. James  Original Message  From: animesh saxena <animesh.saxena@...> To: james hirschorn <j_hirschorn@...> Cc: quantlibusers@...; quantlibdev@... Sent: Mon, July 19, 2010 7:22:54 PM Subject: Re: [Quantlibdev] [Quantlibusers] Poisson process Why not just have a gamma process. it will solve both the issues. VG Process can be coded via difference of two gamma processes Also it's more generic compared to PoissonProcess Am also missing processes which allow fat tailed distributions in Quantlib On 7/19/10 9:09 PM, james hirschorn wrote: > Thanks Dima and Dominik, > > (1) If you don't mind a comment by a newbie: I think the documentation for > StochasticProcess and StochasticProcess1D is misleading. The Detailed > Description does not mention the possibility of including jump processes in > derived classes. > > (2) Is there any point in implementing a PoissonProcess class? > > (3) The reason for my original question was that I was looking for the Variance > Gamma process. Is there some plan to implement this? > > James > > >  Original Message  > From: Dominik Holenstein<dholenstein@...> > To: james hirschorn<j_hirschorn@...> > Sent: Mon, July 19, 2010 2:22:38 AM > Subject: Re: [Quantlibusers] Poisson process > > Poisson distribution is here: > Quantlib\QuantLib1.0.1\ql\math\distributions\poissondistribution.hpp > > Used here: >Quantlib\QuantLib1.0.1\ql\pricingengines\vanilla\batesengine.hpp/batesengine.cpp >p > > Quantlib\QuantLib1.0.1\ql\processes\batesprocess.hpp/batesprocess.cpp > Quantlib\QuantLib1.0.1\ql\math\randomnumbers\rngtraits.hpp > > Dominik > > > > > On Mon, Jul 19, 2010 at 2:43 AM, james hirschorn<j_hirschorn@...> wrote: >> Looking at the documentation, it appears that QuantLib only implements >> stochastic processes based on Brownian motion, i.e. Ito processes. >> >> Is this correct? There is no Poisson process for example? >> >> Thanks, >> J >> >> >> >> >>  >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst >> _______________________________________________ >> QuantLibusers mailing list >> QuantLibusers@... >> https://lists.sourceforge.net/lists/listinfo/quantlibusers >> > > > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > QuantLibdev mailing list > QuantLibdev@... > https://lists.sourceforge.net/lists/listinfo/quantlibdev >  Regards, Animesh Saxena (http://quantanalysis.wordpress.com) 
From: <tarpanelli@li...>  20100721 21:09:16

Hi all, I am using quantlib in Matlab but the job is quite frustrating because of Matlab mexfiles. I would like to know if someone has experience on this staff and if yes I would like to know if it is possible to pass directly from c++ to matlab (via mex file) directly the object created in c++ and reuse their structure. Second question is about Mathematica link...any one knows any version later than those implemented by Niels..I mean is there any link with Mathematica on the latest version of quantlib? thanks rgrds P 
From: animesh saxena <animesh.saxena@gm...>  20100719 23:23:10

Why not just have a gamma process. it will solve both the issues. VG Process can be coded via difference of two gamma processes Also it's more generic compared to PoissonProcess Am also missing processes which allow fat tailed distributions in Quantlib On 7/19/10 9:09 PM, james hirschorn wrote: > Thanks Dima and Dominik, > > (1) If you don't mind a comment by a newbie: I think the documentation for > StochasticProcess and StochasticProcess1D is misleading. The Detailed > Description does not mention the possibility of including jump processes in > derived classes. > > (2) Is there any point in implementing a PoissonProcess class? > > (3) The reason for my original question was that I was looking for the Variance > Gamma process. Is there some plan to implement this? > > James > > >  Original Message  > From: Dominik Holenstein<dholenstein@...> > To: james hirschorn<j_hirschorn@...> > Sent: Mon, July 19, 2010 2:22:38 AM > Subject: Re: [Quantlibusers] Poisson process > > Poisson distribution is here: > Quantlib\QuantLib1.0.1\ql\math\distributions\poissondistribution.hpp > > Used here: > Quantlib\QuantLib1.0.1\ql\pricingengines\vanilla\batesengine.hpp/batesengine.cpp > > Quantlib\QuantLib1.0.1\ql\processes\batesprocess.hpp/batesprocess.cpp > Quantlib\QuantLib1.0.1\ql\math\randomnumbers\rngtraits.hpp > > Dominik > > > > > On Mon, Jul 19, 2010 at 2:43 AM, james hirschorn<j_hirschorn@...> wrote: >> Looking at the documentation, it appears that QuantLib only implements >> stochastic processes based on Brownian motion, i.e. Ito processes. >> >> Is this correct? There is no Poisson process for example? >> >> Thanks, >> J >> >> >> >> >>  >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst >> _______________________________________________ >> QuantLibusers mailing list >> QuantLibusers@... >> https://lists.sourceforge.net/lists/listinfo/quantlibusers >> > > > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > QuantLibdev mailing list > QuantLibdev@... > https://lists.sourceforge.net/lists/listinfo/quantlibdev >  Regards, Animesh Saxena (http://quantanalysis.wordpress.com) 
From: james hirschorn <j_hirschorn@ya...>  20100719 15:39:36

Thanks Dima and Dominik, (1) If you don't mind a comment by a newbie: I think the documentation for StochasticProcess and StochasticProcess1D is misleading. The Detailed Description does not mention the possibility of including jump processes in derived classes. (2) Is there any point in implementing a PoissonProcess class? (3) The reason for my original question was that I was looking for the Variance Gamma process. Is there some plan to implement this? James  Original Message  From: Dominik Holenstein <dholenstein@...> To: james hirschorn <j_hirschorn@...> Sent: Mon, July 19, 2010 2:22:38 AM Subject: Re: [Quantlibusers] Poisson process Poisson distribution is here: Quantlib\QuantLib1.0.1\ql\math\distributions\poissondistribution.hpp Used here: Quantlib\QuantLib1.0.1\ql\pricingengines\vanilla\batesengine.hpp/batesengine.cpp Quantlib\QuantLib1.0.1\ql\processes\batesprocess.hpp/batesprocess.cpp Quantlib\QuantLib1.0.1\ql\math\randomnumbers\rngtraits.hpp Dominik On Mon, Jul 19, 2010 at 2:43 AM, james hirschorn <j_hirschorn@...> wrote: > Looking at the documentation, it appears that QuantLib only implements > stochastic processes based on Brownian motion, i.e. Ito processes. > > Is this correct? There is no Poisson process for example? > > Thanks, > J > > > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > QuantLibusers mailing list > QuantLibusers@... > https://lists.sourceforge.net/lists/listinfo/quantlibusers > 
From: Dima <dimathematician@go...>  20100719 11:47:36

I can't find a constructor for the Euribor Overnight rate. And I can't use the standard Euribor constructor which points me to the "dedicated DailyTenor constructor". Where can I find the dedication? 
From: Luigi Ballabio <luigi.ballabio@gm...>  20100716 15:25:24

Hi all, just a quick note to say that I'll be in vacation for the next couple of weeks (without a connection the internetI'm told it does a lot of good.) Therefore, I won't be answering posts to the mailing lists until the beginning of August. If you never considered answering posts from fellow users, this might be a good time to begin... See you, Luigi  Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away.  Antoine de SaintExupery 
From: quantobe <quantobe@go...>  20100716 14:30:24

Hello all, I am quite new to ql, so bear with me if I'm off in my post. I need to implement swing option pricing. the setting under which I want to implement this is as in this paper: http://www.springerlink.com/content/f1m78783l64rj300/  Basically I m going to use OU process  One factor model for dynamics of forward curve (as in above paper)  using trinomial tree for pricing engine  defining a new instrument as swing option. I need to have a concrete one factor model class for implementing some option pricing in commodities. I need this really to implement calculation of spot price which is comprised of a stochastic part (solution to OU process) plus a deterministic part. as I can see the OneFactorModel in short rate model is an abstract class, from which i dont need shortRateDynamics, shortRateTree etc. I think All I really need is something that using which I can build a tree representing the dynamics ofmy OU process. My question is that shall I use an existing class here, or shall derive my own ? Any help is greatly appreciated. 
From: Dirk Eddelbuettel <edd@de...>  20100715 15:22:44

Hi all, We're trying to put together RQuantLib for Win64. RQuantLib has worked for many years using Win 32bit, and as an R extension requires to be built with the same compiler as R  hence MinGW. That works fine using the DevC++ project file. Now R is turning to dual builds for 32 and 64 bit Windows using the MinGW versions of gcc / g++ 4.5. Has anybody tried this toolchain for QuantLib? Does DevC++ exist, or does one point the 32bit IDE at the 64bit compilers? Thanks for any pointers.  Regards, Dirk 
From: <japari@fr...>  20100713 15:08:56

Hi again, Its not a large difference though, have you played around with schedule rules, year fractions etc...? e.g. the bootstrap date is May 15th, so the year fraction is above 0.25 for the first period. Regards Pepe  Mail Original  De: "animesh saxena" <animesh.saxena@...> À: japari@... Cc: quantlibdev@... Envoyé: Lundi 12 Juillet 2010 21h28:27 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: [Quantlibdev] Survival Probability Pepe, Thanks for your mail. I located the class and could understand the implementation a bit. Another issue is I tried running the CDS example in quantlib reference. It gave following output. 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.0299607 Some survival probability values: 1Y survival probability: 97.040061 % expected: 97.040000 % 2Y survival probability: 94.175780 % expected: 94.180000 % I am assuming it is calculating implied survival probabilities based on Credit Spreads of 150bps, taken in the example. Assuming recover rate of 50%, and using the standard bootstrapping approach. As per bootstrapping default leg = coupon leg. So I am getting these values for year 1 and 2. 97.060795% For year 2, 94.2338% Attaching excel sheet for simple calculations done for CDS. From these values it's easy to back out hazard rate using S(t) = exp^(lambda * t) = 97.060795, where lambda is hazard rate. For first case it's 2.98326% Thanks Animesh Saxena (http://quantanalysis.wordpress.com) On 7/11/10 3:28 PM, japari@... wrote: > Hi, > DefaultDensityStructure does not rely on a hazard rate model to compute the probabilities. You might well have other ways to compute them. Dont be confused by the methods in the parent class, you can still compute the rates. But see that > DefaultDensityStructure::defaultDensityImpl > does need to be making any reference to a HR model. Its more 'abstract' conceptually > > The more specialized class and method: > HazardRateStructure::survivalProbabilityImpl > is what you have in mind. > > Hope it helps. > Pepe > > >  Mail Original  > De: "animesh saxena"<animesh.saxena@...> > À: quantlibdev@... > Envoyé: Samedi 10 Juillet 2010 17h06:02 GMT 08:00 Tijuana / Baja California > Objet: [Quantlibdev] Survival Probability > > Minor doubt in defaultdensitystructure.cpp > > In the function > Probability DefaultDensityStructure::survivalProbabilityImpl(Time t) > const { > static GaussChebyshevIntegration integral(48); > // this stores the address of the method to integrate (so that > // we don't have to insert its full expression inside the > // integral belowit's long enough already) > Real (DefaultDensityStructure::*f)(Time) const = > &DefaultDensityStructure::defaultDensityImpl; > // the GaussChebyshev quadratures integrate over [1,1], > // hence the remapping (and the Jacobian term t/2) > Probability P = 1.0  integral(remap(bind(f,this,_1), t)) * t/2.0; > //QL_ENSURE(P>= 0.0, "negative survival probability"); > return std::max<Real>(P, 0.0); > } > > The following code is present. If lambda is constant then survival > probability is exp(lambda * t) > If not then we integrate to find lambda over [0,t] and it becomes > exp(Integral over [0,t] lambda dt) > > In the code it looks like it is calculating default probability which is > 1  P or 1  Survival Probability. > Maybe my understanding is wrong. Can someone explain? > > > Probability P = 1.0  integral(remap(bind(f,this,_1), t)) * t/2.0; > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > QuantLibdev mailing list > QuantLibdev@... > https://lists.sourceforge.net/lists/listinfo/quantlibdev > 
From: Luigi Ballabio <luigi.ballabio@gm...>  20100713 13:00:39

On Fri, 20100611 at 09:49 +0800, P Nelnik wrote: > Due to the current quantlib compiler settings, access violations are > not caught with catch(...) > as a result we can have some rather ungraceful crashes. > > I wonder are there reasons why the settings are the way they are? I don't think there's a particular reason. It might have been ported from an earlier compiler version, or the compiler defaults. We just didn't give it much thought. > I'd suggest changing the settings. > To do this in MS Visual C++ 2008, click on: > Project > Properties > Configuration Properties > C/C++ > Code > Generatoin > and set: > Enable C++ Exceptions > to > Yes With SEH Exceptions (/EHa) > rather than > Yes ( /EHsc) Ok, I'll do it for next release. Does the setting just add some errorcatching code, or is there any binarycompatibility issue to be aware of? Luigi  Steinbach's Guideline for Systems Programming: Never test for an error condition you don't know how to handle. 
From: Luigi Ballabio <luigi.ballabio@gm...>  20100713 12:54:30

On Mon, 20100712 at 15:47 0500, Kakhkhor Abdijalilov wrote: > >We should define P though. Do you care to give it a try? > I would, but never used doxygen before. No problem, just send me the text. > >> 5. instrument.hpp > >> "virtual" can be omitted from the declaration of 'performCalculations'. > > >No, that's intentional. We wanted to leave it virtual so that one can > >override the engine mechanism if needed. > > It is not a bug, but more like pedantic adherence to the coding style. > performCalculations is declared virtual in LazyObject. Sorry, I though you meant to declare it as nonvirtual. You're right, it's redundant. It doesn't hurt though. Luigi  When I was a boy of fourteen, my father was so ignorant I could hardly stand to have the old man around. But when I got to be twentyone, I was astonished at how much the old man had learned in seven years.  Mark Twain 
From: Kakhkhor Abdijalilov <kabdijalilov@gm...>  20100712 20:47:41

>> 1. generalstatistics.hpp >> In reset() method use "the swap trick" to reset the vector of >> samples. The assignment >> of an empty vector doesn't free the storage. (Item 17 in >> "Effective STL"). >I'm not sure about that. It's likely that after a reset(), we'll start >adding new samples, in which case the storage will save us an >allocation. Agree. The storage can be reused later. In that case, we could simply use vector's clear method instead of assigning an empty vector. >We should define P though. Do you care to give it a try? I would, but never used doxygen before. >> 5. instrument.hpp >> "virtual" can be omitted from the declaration of 'performCalculations'. >No, that's intentional. We wanted to leave it virtual so that one can >override the engine mechanism if needed. It is not a bug, but more like pedantic adherence to the coding style. performCalculations is declared virtual in LazyObject. We could drop the keyword virtual when overwriting performCalculations in Instrument, just like we drop the keyword virtual when overwriting all other virtual methods in derived classes. Regards, Kakhkhor Abdijalilov. 
From: animesh saxena <animesh.saxena@gm...>  20100712 19:29:31

Pepe, Thanks for your mail. I located the class and could understand the implementation a bit. Another issue is I tried running the CDS example in quantlib reference. It gave following output. 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.0299607 Some survival probability values: 1Y survival probability: 97.040061 % expected: 97.040000 % 2Y survival probability: 94.175780 % expected: 94.180000 % I am assuming it is calculating implied survival probabilities based on Credit Spreads of 150bps, taken in the example. Assuming recover rate of 50%, and using the standard bootstrapping approach. As per bootstrapping default leg = coupon leg. So I am getting these values for year 1 and 2. 97.060795% For year 2, 94.2338% Attaching excel sheet for simple calculations done for CDS. From these values it's easy to back out hazard rate using S(t) = exp^(lambda * t) = 97.060795, where lambda is hazard rate. For first case it's 2.98326% Thanks Animesh Saxena (http://quantanalysis.wordpress.com) On 7/11/10 3:28 PM, japari@... wrote: > Hi, > DefaultDensityStructure does not rely on a hazard rate model to compute the probabilities. You might well have other ways to compute them. Dont be confused by the methods in the parent class, you can still compute the rates. But see that > DefaultDensityStructure::defaultDensityImpl > does need to be making any reference to a HR model. Its more 'abstract' conceptually > > The more specialized class and method: > HazardRateStructure::survivalProbabilityImpl > is what you have in mind. > > Hope it helps. > Pepe > > >  Mail Original  > De: "animesh saxena"<animesh.saxena@...> > À: quantlibdev@... > Envoyé: Samedi 10 Juillet 2010 17h06:02 GMT 08:00 Tijuana / Baja California > Objet: [Quantlibdev] Survival Probability > > Minor doubt in defaultdensitystructure.cpp > > In the function > Probability DefaultDensityStructure::survivalProbabilityImpl(Time t) > const { > static GaussChebyshevIntegration integral(48); > // this stores the address of the method to integrate (so that > // we don't have to insert its full expression inside the > // integral belowit's long enough already) > Real (DefaultDensityStructure::*f)(Time) const = > &DefaultDensityStructure::defaultDensityImpl; > // the GaussChebyshev quadratures integrate over [1,1], > // hence the remapping (and the Jacobian term t/2) > Probability P = 1.0  integral(remap(bind(f,this,_1), t)) * t/2.0; > //QL_ENSURE(P>= 0.0, "negative survival probability"); > return std::max<Real>(P, 0.0); > } > > The following code is present. If lambda is constant then survival > probability is exp(lambda * t) > If not then we integrate to find lambda over [0,t] and it becomes > exp(Integral over [0,t] lambda dt) > > In the code it looks like it is calculating default probability which is > 1  P or 1  Survival Probability. > Maybe my understanding is wrong. Can someone explain? > > > Probability P = 1.0  integral(remap(bind(f,this,_1), t)) * t/2.0; > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > QuantLibdev mailing list > QuantLibdev@... > https://lists.sourceforge.net/lists/listinfo/quantlibdev > 
From: Luigi Ballabio <luigi.ballabio@gm...>  20100712 16:41:32

On Mon, 20100705 at 16:51 0500, Kakhkhor Abdijalilov wrote: > I was looking into QuantLib implementation recently and noticed > several things which could be improved (IMHO). These aren't really > bugs, more like small issues related to documentation, coding style > and efficiency. Here is my list. Kakhkhor, thanks for the report. Here we go: > ============================================================= > 1. generalstatistics.hpp > In reset() method use "the swap trick" to reset the vector of > samples. The assignment > of an empty vector doesn't free the storage. (Item 17 in > "Effective STL"). I'm not sure about that. It's likely that after a reset(), we'll start adding new samples, in which case the storage will save us an allocation. > Doxygen for percentile() should say something like this: > Smallest x from the sample, such that P(X<=x) >= y. > > Doxygen for topPercentile() should say somthing like this: > Largest x from the sample, such that P(X>=x) >= y. We should define P though. Do you care to give it a try? > 2. capfloortermvolcurve.hpp. > Use private inheritance from boost::noncopyable. Done. > 3. longstaffschwartzpathpricer.hpp > It is very hard to understand what is going on here. > > Can we replace it with this simple loop? > > \code > for(Size i=0; i<n; ++i) > prices[i] = (*pathPricer_)(paths_[i], len1); > \endcode Done. > At the end of LongstaffSchwartzPathPricer::calibrate() use "the > swap trick" to reset > the vector paths_, instead of using paths_.clear(). Clearing a > vector doesn't free the storage. > The calibration of LongstaffSchwartzPathPricer requires tons of > memory. We better to free > all the memory used by the vector paths_. Done. > 5. instrument.hpp > "virtual" can be omitted from the declaration of 'performCalculations'. No, that's intentional. We wanted to leave it virtual so that one can override the engine mechanism if needed. > 6. randomsequencegenerator.hpp > Document that both RNG::next() and RNG::nextInt32() are required. Done. > 7. timergrid.cpp > replace times_.reserve(steps) with times_.reserve(steps+1), because times_ > stores steps+1 values. Done. Thanks again, Luigi  These are my principles, and if you don't like them... Well, I have others.  Groucho Marx 
From: <japari@fr...>  20100711 09:58:38

Hi, DefaultDensityStructure does not rely on a hazard rate model to compute the probabilities. You might well have other ways to compute them. Dont be confused by the methods in the parent class, you can still compute the rates. But see that DefaultDensityStructure::defaultDensityImpl does need to be making any reference to a HR model. Its more 'abstract' conceptually The more specialized class and method: HazardRateStructure::survivalProbabilityImpl is what you have in mind. Hope it helps. Pepe  Mail Original  De: "animesh saxena" <animesh.saxena@...> À: quantlibdev@... Envoyé: Samedi 10 Juillet 2010 17h06:02 GMT 08:00 Tijuana / Baja California Objet: [Quantlibdev] Survival Probability Minor doubt in defaultdensitystructure.cpp In the function Probability DefaultDensityStructure::survivalProbabilityImpl(Time t) const { static GaussChebyshevIntegration integral(48); // this stores the address of the method to integrate (so that // we don't have to insert its full expression inside the // integral belowit's long enough already) Real (DefaultDensityStructure::*f)(Time) const = &DefaultDensityStructure::defaultDensityImpl; // the GaussChebyshev quadratures integrate over [1,1], // hence the remapping (and the Jacobian term t/2) Probability P = 1.0  integral(remap(bind(f,this,_1), t)) * t/2.0; //QL_ENSURE(P >= 0.0, "negative survival probability"); return std::max<Real>(P, 0.0); } The following code is present. If lambda is constant then survival probability is exp(lambda * t) If not then we integrate to find lambda over [0,t] and it becomes exp(Integral over [0,t] lambda dt) In the code it looks like it is calculating default probability which is 1  P or 1  Survival Probability. Maybe my understanding is wrong. Can someone explain? Probability P = 1.0  integral(remap(bind(f,this,_1), t)) * t/2.0;  This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst _______________________________________________ QuantLibdev mailing list QuantLibdev@... https://lists.sourceforge.net/lists/listinfo/quantlibdev 
From: animesh saxena <animesh.saxena@gm...>  20100711 00:06:14

Minor doubt in defaultdensitystructure.cpp In the function Probability DefaultDensityStructure::survivalProbabilityImpl(Time t) const { static GaussChebyshevIntegration integral(48); // this stores the address of the method to integrate (so that // we don't have to insert its full expression inside the // integral belowit's long enough already) Real (DefaultDensityStructure::*f)(Time) const = &DefaultDensityStructure::defaultDensityImpl; // the GaussChebyshev quadratures integrate over [1,1], // hence the remapping (and the Jacobian term t/2) Probability P = 1.0  integral(remap(bind(f,this,_1), t)) * t/2.0; //QL_ENSURE(P >= 0.0, "negative survival probability"); return std::max<Real>(P, 0.0); } The following code is present. If lambda is constant then survival probability is exp(lambda * t) If not then we integrate to find lambda over [0,t] and it becomes exp(Integral over [0,t] lambda dt) In the code it looks like it is calculating default probability which is 1  P or 1  Survival Probability. Maybe my understanding is wrong. Can someone explain? Probability P = 1.0  integral(remap(bind(f,this,_1), t)) * t/2.0; 
From: animesh saxena <animesh.saxena@gm...>  20100707 14:12:46

Stephen, Thanks for the reply :). I don't generally trust semianalytical solutions if FD methods are applicable. The advantage in FD methods is from a trader perspective you can model various scenarios. In programming perspective it might be hard to see. So let me say my 2 bit as a quant / trader. Let's say I find out my greek vega from a very sophisticated model say heston for a barrier option. Standard programming practice / maths says that it's partial derivative of V / sigma. This is where the problem starts. Greeks are interrelated. If gamma of option is positive and volatility is maximum and if you are long that option then it will rise in price and you will earn lots of money (Rake Millions ;) ). If gamma is maximum and volatility is minimum and if you are long the option, it won't affect your position much. Similarly if gamma is negative and volatility is maximum and you are long the option, oh dear you are gone with huge losses. So for exotic structures in which gamma changes signs this modeling is not possible in any of the models available till date! I believe if this can somehow be incorporated into quantlib design it will make it a much more practical tool. More analysis on my post > http://quantanalysis.wordpress.com/2010/02/24/vegathestupidgreek/ Below is a simple implementation I have used at my workplace. Parameters need to be fudged. I agree implementation might not be very stable, but it can be done in a better way with other methods like crank nicholson. I know the code is very badly written, but anyway my point is making the fd model more generic so any partial differential equation can be fudged as an operator. Of course too much waste for multi asset options coz it will be too many for loops. So just wanted to know if this is possible? I can help with the math, and these days trying to learn the quantlib design...hopefully will be able to pick up! Thanks again for reading the mail, Animesh Saxena Associate (Exotic Derivatives) Blog > http://quantanalysis.wordpress.com void stochasticvol(double expiry, double strike, double interestrate, int smax, int sigmax, double dt) { double ds,dsig,a,b,c,d,rho,deltas,deltasig,deltasig1,deltasig2,gammas,gammasig,xgamma,theta; int N,i,j,k; ds = strike / smax*2; dsig = (double)(1 / (double)sigmax); N = (int)(expiry/dt) + 1; dt = expiry/N; a = 0.2; b=1; c=1; d=1; rho = 0; double S[smax]; double Sig[sigmax]; double previousprices[smax][sigmax]; double newprices[smax][sigmax]; for(i=0;i<=smax;i++){ S[i] = i * ds; } std::cout<<ds; for(j=0;j<=sigmax;j++) Sig[j] = dsig * j; for(i=0;i<=smax;i++) for(j=0;j<=sigmax;j++) { previousprices[i][j] = ((S[i]  strike)>0?S[i]strike:0); } for(k=1;k<=N;k++) { for(i=0;i<=smax1;i++) { for(j=0;j<=sigmax1;j++) { deltas = (previousprices[i+1][j]  previousprices[i1][j])/(2*ds); deltasig1 = (previousprices[i][j+1]  previousprices[i][j])/dsig; deltasig2 = (previousprices[i][j]  previousprices[i][j1])/dsig; deltasig = deltasig1; if((ab * Sig[j]) < 0) deltasig = deltasig2; gammas = (previousprices[i+1][j]  2 * previousprices[i][j] + previousprices[i1][j])/(ds*ds); gammasig = (previousprices[i][j+1]  2 * previousprices[i][j] + previousprices[i][j1])/(dsig*dsig); xgamma = (previousprices[i+1][j+1]  previousprices[i+1][j1]  previousprices[i1][j+1] + previousprices[i1][j1])/(4*ds*dsig); theta = 0.5 * Sig[j]*Sig[j] *S[i] *S[i] * gammas + interestrate * S[i] * deltas  interestrate * previousprices[i][j] + 0.5 * d *d * Sig[j] * gammasig + c*(ab * Sig[j])*deltasig + rho * Sig[j] * S[i] * d * pow(Sig[j],2) * xgamma; newprices[i][j] = previousprices[i][j] + dt *theta; } } for(j=0;j<=sigmax1;j++) newprices[smax][j] = 2 * newprices[smax1][j]  newprices[smax2][j]; for(i=0;i<=smax;i++) newprices[i][sigmax] = 2 * newprices[i][sigmax1]  newprices[i][sigmax2]; for(i=0;i<=smax;i++) for(j=0;j<=sigmax;j++) { previousprices[i][j] = newprices[i][j]; } } for(i=0;i<smax;i++) for(j=0;j<sigmax;j++){ std::cout<<"Spot" << (i*ds) << "Vol:"<< (j*dsig) << "Price:" << newprices[i][j]<<"\n"; } } Stephen Tse wrote: > Have you tried to implement it using other language and check the > accuracy (against European call prices which has semianalytical > formula under the Heston model)? > > As far as I know, the mixedderivative term is very difficult to > handle and I have seen no research paper using standard FD method to > discretize the Heston PDE. One recent paper uses ADI and may be of > interest to you. Please see attachment. > > > On Tue, Jul 6, 2010 at 5:43 AM, animesh saxena > <animesh.saxena@... <mailto:animesh.saxena@...>> wrote: > > > No FD method solution in the case of a generic partial > differential equation like (Stochastic Vol Model) > > for {d sigma = p dt + q dX}, p = (a – b sigma2) > > Do read the pdf for bit more understanding. It's just a single page! > > I am not sure if this is implemented in quantlib, or maybe I don't > know how to use it. > > Thanks for ur time > > Animesh Saxena > > Associate > > (Exotic Derivatives) > > Blog > http://quantanalysis.wordpress.com > > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first <http://sprint.com/first>;  > http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > QuantLibdev mailing list > QuantLibdev@... > <mailto:QuantLibdev@...> > https://lists.sourceforge.net/lists/listinfo/quantlibdev > > > > >  > Stephen Tse > http://www.cs.uwaterloo.ca/~sttse/ <http://www.cs.uwaterloo.ca/%7Esttse/>; 
From: Stephen Tse <koatse@gm...>  20100707 13:51:08

From: animesh saxena <animesh.saxena@gm...>  20100706 09:44:02

No FD method solution in the case of a generic partial differential equation like (Stochastic Vol Model) for {d sigma = p dt + q dX}, p = (a – b sigma2) Do read the pdf for bit more understanding. It's just a single page! I am not sure if this is implemented in quantlib, or maybe I don't know how to use it. Thanks for ur time Animesh Saxena Associate (Exotic Derivatives) Blog > http://quantanalysis.wordpress.com 
From: Kakhkhor Abdijalilov <kabdijalilov@gm...>  20100705 22:17:07

I was looking into QuantLib implementation recently and noticed several things which could be improved (IMHO). These aren't really bugs, more like small issues related to documentation, coding style and efficiency. Here is my list. ============================================================= 1. generalstatistics.hpp In reset() method use "the swap trick" to reset the vector of samples. The assignment of an empty vector doesn't free the storage. (Item 17 in "Effective STL"). Doxygen for percentile() should say something like this: Smallest x from the sample, such that P(X<=x) >= y. Doxygen for topPercentile() should say somthing like this: Largest x from the sample, such that P(X>=x) >= y. 2. capfloortermvolcurve.hpp. Use private inheritance from boost::noncopyable. 3. longstaffschwartzpathpricer.hpp It is very hard to understand what is going on here. \code std::transform(paths_.begin(), paths_.end(), prices.begin(), boost::bind(&EarlyExercisePathPricer<PathType> ::operator(), pathPricer_.get(), _1, len1)); \endcode Can we replace it with this simple loop? \code for(Size i=0; i<n; ++i) prices[i] = (*pathPricer_)(paths_[i], len1); \endcode At the end of LongstaffSchwartzPathPricer::calibrate() use "the swap trick" to reset the vector paths_, instead of using paths_.clear(). Clearing a vector doesn't free the storage. The calibration of LongstaffSchwartzPathPricer requires tons of memory. We better to free all the memory used by the vector paths_. 5. instrument.hpp "virtual" can be omitted from the declaration of 'performCalculations'. 6. randomsequencegenerator.hpp Document that both RNG::next() and RNG::nextInt32() are required. 7. timergrid.cpp replace times_.reserve(steps) with times_.reserve(steps+1), because times_ stores steps+1 values. ============================================================= Regards, Kakhkhor Abdijalilov. 
From: animesh saxena <animesh.saxena@gm...>  20100703 21:53:03

I am trying to create an instance of fd class using this call FiniteDifferenceModel<CrankNicolson<TridiagonalOperator> > Obviously this is not possible since the constructor is (const operator_type& L, const bc_set& bcs, const std::vector<Time>& stoppingTimes = std::vector<Time>()) What I understand is stoppingTimes is an array for maturities. In case of plain vanilla or simple up out call it might be single maturity say 1 year. So that information can be easily sent through. The other two fields operator_type and bc_set are wierdos. Tough to get at first glance :) . Since the documentation is obsolete I tried opening up lots of header files and lots of cpp files to wrap around the code in my head. (Frankly speaking I come from C Linux Kernel Coding world so C++ is a mess to me!). Anyway if someone has followed my problem till this point do read on! Again operator_type and bc_set are members of Evolver class which can be something like CrankNicolson. So I rushed to it's header file cranknicolson.hpp to get some clues. But still I can't figure out what's operator_type or bc_set. My best guess was TridiagonalOperator class, but still that didn't work. Since most of the FD engines given in the sample examples are of useless from trading perspective I was creating more practicle ones which can be used more from static hedging perspective. So it would be really helpful if someone can help me understand at least how to initialize the generic FiniteDifferenceModel class. I guess I should send this to dev's list, but well will wait...if I don't get the reply I will forward coz i guess questions are not that simple ;) Thanks for reading, Animesh Saxena (Associate) Exotic Derivatives NOMURA 
From: Ferdinando M. Ametrano <ferdinando@am...>  20100701 09:10:14

Luigi Ballabio wrote: > I don't think the change is backward compatible, as a vector of Derived > is not convertible to a vector of Basedid you try compiling the > relevant example? sorry, my bad habit of not compiling examples. If only there was an equivalent test for each example... > I guess you'll need to overload the constructor... done thank you ciao  Nando 