- Cuchulainn
**Posts:**59713**Joined:****Location:**Amsterdam-
**Contact:**

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.

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

- Cuchulainn
**Posts:**59713**Joined:****Location:**Amsterdam-
**Contact:**

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.

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.

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.

- FinancialAlex
**Posts:**81**Joined:**

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)

- FinancialAlex
**Posts:**81**Joined:**

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

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?

Alan, at least some of them do, you can verify it as such: http://www.google.com/search?q=site:www ... d::complex

- Cuchulainn
**Posts:**59713**Joined:****Location:**Amsterdam-
**Contact:**

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.

- FinancialAlex
**Posts:**81**Joined:**

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

GZIP: On