SERVING THE QUANTITATIVE FINANCE COMMUNITY

  • 1
  • 2
  • 3
  • 4
  • 5
  • 13
 
User avatar
Cuchulainn
Topic Author
Posts: 59921
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Using Quantlib

March 20th, 2014, 8:33 pm

QuoteOriginally posted by: daveangelQuoteOriginally posted by: CuchulainnIf we use QL Date class as a key in a std::map<> (with the default comparitor ==) can we get an issue with performance? The == compares the computed serial numbers (by std::advance()).Would a Boost hash function be faster or possible?I would think that QL stores the serial number in the class object -so readonly.Yes, I suppose that should OK. If we create dates in a loop with offsst set operators etc. then I need to check if there are possible optimisation tricks.
 
User avatar
Cuchulainn
Topic Author
Posts: 59921
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Using Quantlib

March 22nd, 2014, 11:39 am

QuoteMaybe you can drop the Date loop altogether? It's effect just a list of equally spaced integers. Why would you store the values 35000, 35001, 35002, 35003 etc in a map?? Good point. The Date uses serial number which is fine as it is almost a hash in itself.An interesting follow-in is when you are doing sensitivity analysis with data from a database. Connection and recordset objects will affect performance if they are opened and closed a lot and at the wrong level. I reckon that even single per-record optimistic locking is not good?One could use disconnected data and do everything in memory.
Last edited by Cuchulainn on March 21st, 2014, 11:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Topic Author
Posts: 59921
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Using Quantlib

March 24th, 2014, 1:27 pm

QuoteOriginally posted by: outrunA common patterns when filling a relational database is to first insert data into a temporary table. The temporary table is a private table, every connections gets its personal version. This ensures that you are the only one acting on it, and that will allow you to manipulate it without worrying about concurrency. Once you have filled the temporary table you then move all the bulk data from the temp table into the real table(s) in a single transaction. During that move the main table might get partially locked. It will also allow you to update multiple tables in a single transaction, eg convert a flat redundant format into a relational format spanning multiple tables.In a special case one only needs to read the records into memory (forward read-only, single user). For example, with ADO.NET with a range of databases such as SQL Server, sqlite3, MySQL etc. BTW persistence in a library would be a useful addition to CSV files.
Last edited by Cuchulainn on March 23rd, 2014, 11:00 pm, edited 1 time in total.
 
User avatar
larryglchen
Posts: 5
Joined: March 20th, 2014, 6:47 am

Using Quantlib

March 27th, 2014, 3:35 pm

Does QL support curve surfaces? I guess it meaning fitting multiple rates curves (disc, libor3m, libor6m etc) at the same time, Instead of building individual curves separately. In Nomura days, we called the project KCurves.
 
User avatar
pcaspers
Posts: 695
Joined: June 6th, 2005, 9:49 am

Using Quantlib

March 27th, 2014, 6:47 pm

QuoteOriginally posted by: outrunYou mean dual curve bootstrapping / OIS discounting?I have no idea if QL has that, it's a popular methods so I expect it will? (But maybe you mean something else?)yes, that is possible
 
User avatar
Cuchulainn
Topic Author
Posts: 59921
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Using Quantlib

March 27th, 2014, 6:56 pm

Hi pcaspers,Regarding QL DE do I need 1.4 for the [min, max] constraints? Is the code based on Storn/Price 1997? How does it compare to this (on google) which has some good mutation operators?QuoteDifferential Evolution Algorithm With Strategy Adaptation for Global Numerical Optimization (2009)A. K. Qin, V. L. Huang, and P. N. SuganthanThe book by Storn et al. has some C++ code which is quite compact (it has a few fixable bugs but the code also stucture is quite good). //General follow-on: is there a change control management/code review process in the QL community? Like, for example 3 different s/w environments like Development, Acceptance, Prodcution?
Last edited by Cuchulainn on March 26th, 2014, 11:00 pm, edited 1 time in total.
 
User avatar
larryglchen
Posts: 5
Joined: March 20th, 2014, 6:47 am

Using Quantlib

March 27th, 2014, 10:10 pm

QuoteOriginally posted by: outrunYou mean dual curve bootstrapping / OIS discounting?Basically yes. But beyond building two curves together, in fact building all rates curves together. Yes related to OIS discounting.
 
User avatar
Cuchulainn
Topic Author
Posts: 59921
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Using Quantlib

March 27th, 2014, 10:14 pm

In Chapter 16 of "C# in Financial Markets" we discuss multi-curve Building in C#.
 
User avatar
pcaspers
Posts: 695
Joined: June 6th, 2005, 9:49 am

Using Quantlib

March 28th, 2014, 6:33 am

QuoteOriginally posted by: CuchulainnRegarding QL DE do I need 1.4 for the [min, max] constraints? there are a number of fixes for the constraint classes in 1.4. However I think you don't need them as longas you derive you own implementation from Constraint.
 
User avatar
Cuchulainn
Topic Author
Posts: 59921
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Using Quantlib

March 28th, 2014, 4:22 pm

QuoteOriginally posted by: pcaspersQuoteOriginally posted by: CuchulainnRegarding QL DE do I need 1.4 for the [min, max] constraints? there are a number of fixes for the constraint classes in 1.4. However I think you don't need them as longas you derive you own implementation from Constraint.Could we we write the problem in Lagrange multiplier form to get an unconstrained and then apply DE? Then we can accomodate more general constraints as well? But will I have a problem generating the initial population because the boundaries are 'gone' so to speak?I can try it on an example.
Last edited by Cuchulainn on March 27th, 2014, 11:00 pm, edited 1 time in total.
 
User avatar
pcaspers
Posts: 695
Joined: June 6th, 2005, 9:49 am

Using Quantlib

March 29th, 2014, 5:34 pm

QuoteOriginally posted by: CuchulainnCould we we write the problem in Lagrange multiplier form to get an unconstrained and then apply DE? Then we can accomodate more general constraints as well? When you say "the problem" are you referring to a specific one or speaking generally ?afaik Lagrange multiplier apply to constraints F( X ) = 0. Does it extend to F( X ) < c ?
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On