Page 2 of 13

Using Quantlib

Posted: March 20th, 2014, 8:33 pm
by Cuchulainn
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.

Using Quantlib

Posted: March 22nd, 2014, 11:39 am
by Cuchulainn
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.

Using Quantlib

Posted: March 24th, 2014, 1:27 pm
by Cuchulainn
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.

Using Quantlib

Posted: March 27th, 2014, 3:35 pm
by larryglchen
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.

Using Quantlib

Posted: March 27th, 2014, 6:47 pm
by pcaspers
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

Using Quantlib

Posted: March 27th, 2014, 6:56 pm
by Cuchulainn
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?

Using Quantlib

Posted: March 27th, 2014, 10:10 pm
by larryglchen
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.

Using Quantlib

Posted: March 27th, 2014, 10:14 pm
by Cuchulainn
In Chapter 16 of "C# in Financial Markets" we discuss multi-curve Building in C#.

Using Quantlib

Posted: March 28th, 2014, 6:33 am
by pcaspers
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.

Using Quantlib

Posted: March 28th, 2014, 4:22 pm
by Cuchulainn
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.

Using Quantlib

Posted: March 29th, 2014, 5:34 pm
by pcaspers
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 ?