Serving the Quantitative Finance Community

 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Numerics Libraries (Foundations)

October 5th, 2011, 11:25 am

Question: Boost Math Toolkit supports nonlinear solvers. Shall we use them in code in the higher layers? + all other relevant discussions here.
Last edited by Cuchulainn on October 4th, 2011, 10:00 pm, edited 1 time in total.
 
User avatar
Paul
Posts: 6604
Joined: July 20th, 2001, 3:28 pm

Numerics Libraries (Foundations)

October 5th, 2011, 11:34 am

I am hoping that this project will encourage people to try out new models (rather than just tweaking old models). This will be assisted by having a sophisticated numerics library.P
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Numerics Libraries (Foundations)

October 5th, 2011, 11:48 am

QuoteOriginally posted by: PaulI am hoping that this project will encourage people to try out new models (rather than just tweaking old models). This will be assisted by having a sophisticated numerics library.POnce we have a decent numlib + OO framework in place will mean that quants can devote more attention to better models. Now a lot of non-prop stuff is being reinvented a lot I would say. Avoiding this fits in with rnorm's Layers. To take 1-factor PDE for the moment, we would first need a taxonomy (categories).
Last edited by Cuchulainn on October 4th, 2011, 10:00 pm, edited 1 time in total.
 
User avatar
frenchX
Posts: 11
Joined: March 29th, 2010, 6:54 pm

Numerics Libraries (Foundations)

October 5th, 2011, 1:03 pm

Linear vs Semilinear (example UVM) vs Fully Nonlinear (example hedging feedback and even more usefull Fokker Planck for McKean process)1st order vs 2nd OrderParabolic vs Elliptic vs Hyperbolic@Paul: I agree that it would be interesting to implement non conventionnal models and non conventionnal methods in addition to the classics. Not interested in a 987th version of Heston ...
Last edited by frenchX on October 4th, 2011, 10:00 pm, edited 1 time in total.
 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

Numerics Libraries (Foundations)

October 5th, 2011, 8:35 pm

QuoteOriginally posted by: CuchulainnQuestion: Boost Math Toolkit supports nonlinear solvers. Shall we use them in code in the higher layers?I assume Cuch means Tools, Constants and Internal Details.I actually like the design of the root-finding algos in there (note: those are all univariate, just as minimization is, so they won't cover the multivariate cases) and see no reason not to -- a caveat is that those have a status of _internal_ implementation (so, AFAIR, Boost community makes no promises on keeping the interfaces stable or even keeping the libs in the future at all), but it is BSL licensed (duh) so we can always adopt it in case it was ever abandoned.I'd also like to point out the existence of dlib C++ library (which is also licensed under the Boost Software License): http://dlib.net/.Of interest are:- Optimization (multivariate, including BFGS and Levenberg-Marquardt -- might be very handy for calibration),- Algorithms (e.g., running_stats -- if we need incremental-stats, Boost.Accumulators also come to mind),- there are also API Wrappers (of note if we ever need BSL-licensed cross-platform (Windows & POSIX) GUI layer). I think it's very well documented, e.g., see:MatrixMatrix ExpressionsNon-Linear Least Squares (this shows how to use Levenberg-Marquardt)
Last edited by Polter on October 4th, 2011, 10:00 pm, edited 1 time in total.
 
User avatar
FinancialAlex
Posts: 1
Joined: April 11th, 2005, 10:34 pm

Numerics Libraries (Foundations)

October 7th, 2011, 4:37 am

Speaking of optimization packages, a very good open source optimization (the very least top 3 in local optimization packages, in my point of view) is IPOPT (https://projects.coin-or.org/Ipopt). It is released as open source code under the Eclipse Public License.A possible contribution might be the best global optimization algorithm (that I know of), namely Differential Evolution (for unconstrained, bounded constrained and fully constrained problems)
 
User avatar
FinancialAlex
Posts: 1
Joined: April 11th, 2005, 10:34 pm

Numerics Libraries (Foundations)

October 7th, 2011, 4:42 am

A possible contribution might be one dimensional integration using doubly adaptive quadratureAnother one might be multidimensional integration using quasi Monte Carlo combined with specialized least square fitting
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Numerics Libraries (Foundations)

October 7th, 2011, 2:52 pm

To be minimally useful for research purposes, IMO, the QFCL project must support complex numbers.In particular, various special functions occur all the time in models, with complex-valued arguments and complex return values.I can't tell from the online docs if Boost supports this concept, but I get a bad feeling that generally, it doesn't.Comments?
 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

Numerics Libraries (Foundations)

October 7th, 2011, 3:30 pm

Alan, at least some of them do, you can verify it as such: http://www.google.com/search?q=site:www ... d::complex
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Numerics Libraries (Foundations)

October 7th, 2011, 5:18 pm

QuoteOriginally posted by: AlanTo be minimally useful for research purposes, IMO, the QFCL project must support complex numbers.In particular, various special functions occur all the time in models, with complex-valued arguments and complex return values.I can't tell from the online docs if Boost supports this concept, but I get a bad feeling that generally, it doesn't.Comments?STL has complex numbers up to transcendental functions.Boost has some fns. for inverse fns.Would you need more dedicated features? (complex-valued numerical quadrature??)
Last edited by Cuchulainn on October 6th, 2011, 10:00 pm, edited 1 time in total.
 
User avatar
FinancialAlex
Posts: 1
Joined: April 11th, 2005, 10:34 pm

Numerics Libraries (Foundations)

October 7th, 2011, 7:31 pm

Another advantage of QFCL project supporting complex numbers is automatic enabling of computation of Greeks using complex step derivative approximation (CDDA) approach. CSDA can be automatically done if the original code is "complexified", i.e., it can work with complex numbers. CSDA gives much better accuracy for Greeks compared to "bump-and-reprice" (finite difference) approach, and the computational effort is usually smaller