SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
Alan
Posts: 9783
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Numerics Libraries (Foundations)

October 7th, 2011, 11:28 pm

QuoteOriginally posted by: CuchulainnQuoteOriginally 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??)Yes, definitely for all integration methods. Also, ideally for various special functions (not just the elementary functions, like cos(x), e^x, etc, built into C/C++ std math).Now I would expect that adding complex support for an integration routine should be quite feasible.But, developing a complex-valued special function is probabably beyond the project's scope.However, let's say I find some (non-Boost) C/C++ version of some special function in another library somewhere -- will I be able to use it, in the integration methods, say?
 
User avatar
Cuchulainn
Topic Author
Posts: 59665
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Numerics Libraries (Foundations)

October 8th, 2011, 6:33 am

QuoteHowever, let's say I find some (non-Boost) C/C++ version of some special function in another library somewhere -- will I be able to use it, in the integration methods, say?I think this is a good idea; if these specialised build on STL even better. BTW STL has whacks of algorithms for containers, some of which will be useful for Complex C (even if it is not a totally ordered field). Saves reinventing a wheel.
Last edited by Cuchulainn on October 7th, 2011, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Topic Author
Posts: 59665
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Numerics Libraries (Foundations)

October 8th, 2011, 6:58 am

QuoteOriginally posted by: FinancialAlexAnother 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 smallerAlex,Would there be separate libraries for FDM. MC? How will the interfaces look like?
 
User avatar
Cuchulainn
Topic Author
Posts: 59665
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Numerics Libraries (Foundations)

October 8th, 2011, 8:51 am

I reckon this will get some interest? FFTW
 
User avatar
FinancialAlex
Posts: 81
Joined: April 11th, 2005, 10:34 pm

Numerics Libraries (Foundations)

October 8th, 2011, 11:05 am

It is indeed one of the best software available related to FFT and DFT. Its quality made Intel to interface it within MKL, the Intel Math library. I think it would be a very useful addition to QFCL
 
User avatar
FinancialAlex
Posts: 81
Joined: April 11th, 2005, 10:34 pm

Numerics Libraries (Foundations)

October 10th, 2011, 2:19 am

Not sure I understand completely the question, so my answer may not address the question 100%. My implementation was based on having separate engines for PDE and, respectively, MC, with several common components, such as payoff classes for various types of trades
 
User avatar
quartz
Posts: 424
Joined: June 28th, 2005, 12:33 pm

Numerics Libraries (Foundations)

October 10th, 2011, 9:46 am

dlib looks really interesting!fftw is a must.Other threads mentioned uBlas, Atlas and eigen. I'm all for eigen: efficient, trivial installation, no configuration needed, nice interface, well documented etc. As noted the only major drawback is that it doesnt go beyond 2 dims. Atlas was a giant leap forward at the time, but eigen seems to be really competitive. Btw did anyone of you make a wide unbiased benchmarking? Otherwise there's also mtl4...I heard however that no lib is really efficient when it comes to sparse matrices, can anyone comment here?
 
User avatar
DevonFangs
Posts: 3004
Joined: November 9th, 2009, 1:49 pm

Numerics Libraries (Foundations)

October 10th, 2011, 11:13 am

QuoteOriginally posted by: outrunFor Laplace inversion?On a side note: for this we should go for the Abate-Whitt approach (here).
 
User avatar
Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Numerics Libraries (Foundations)

October 15th, 2011, 10:01 pm

Freely Available Software for Linear Algebra (September 2011)
 
User avatar
Cuchulainn
Topic Author
Posts: 59665
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Numerics Libraries (Foundations)

October 17th, 2011, 5:32 am

QuoteOriginally posted by: DevonFangsQuoteOriginally posted by: outrunFor Laplace inversion?On a side note: for this we should go for the Abate-Whitt approach (here).What about Tikhonov regularisation as well? See in particular section 4here
Last edited by Cuchulainn on October 16th, 2011, 10:00 pm, edited 1 time in total.
 
User avatar
FinancialAlex
Posts: 81
Joined: April 11th, 2005, 10:34 pm

Numerics Libraries (Foundations)

October 19th, 2011, 5:55 am

There are quite a few scientific papers (and even books dedicated solely to this topic) on regularization, especially of Tikhonov type, because it can really make a difference in finding a better extremum of the cost functional. Thus regularization should be considered, in my opinion, on an as-needed basis. Many papers in computational finance also include regularization, although for many of them the regularization is specialized already. For a more generic approach of regularization in computational finance, one may consult papers/books by Crepey, Cont and Tankov, Engl
 
User avatar
FinancialAlex
Posts: 81
Joined: April 11th, 2005, 10:34 pm

Numerics Libraries (Foundations)

October 19th, 2011, 6:14 am

QuoteOriginally posted by: quartzI heard however that no lib is really efficient when it comes to sparse matrices, can anyone comment here?A recent overview (2009) of various linear algebra libraries (including sparse ones and links to benchmarking) is given in Linear Algebra LibrariesRegarding efficiency of sparse matrices implementation, from my experience there are 2 components to consider in terms of efficiency:a) how fast one can access/write the nonzero elements of the sparse matrix, given in mapped, compressed or coordinate formatb) solving linear systemsFor b) the computational efficiency is influenced as much, if not more, by choice of preconditioning (which is problem dependent) as by the library storage specifics of sparse matrix library. My experience is based on working with moderate scale problems, which had between 1000 and 50000 variables
 
User avatar
Cuchulainn
Topic Author
Posts: 59665
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Numerics Libraries (Foundations)

November 27th, 2011, 3:19 pm

This is Cholesky decomposition using uBLAS using a 4X4 matrix for starters. uBLAS has a lot of functionality that can be added to. It looks good. I think it will be hard to beat.I use doubles.//Also cgm.zip to keep things together.
Attachments
CholeskyNov2011.zip
(1.38 KiB) Downloaded 12 times
CGM.zip
(2.01 KiB) Downloaded 14 times
 
User avatar
Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Numerics Libraries (Foundations)

November 29th, 2011, 5:45 pm

Cuch, "CholeskyNov2011.zip" file uses solely the LU decomposition. There is also (unreferenced, so didn't look at it) procedure "Cholesky".Any chance you could post the version that uses the Cholesky decomposition A = L * L^T = U^T * U ?
 
User avatar
Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Numerics Libraries (Foundations)

November 29th, 2011, 5:50 pm

BTW, it's also not clear if there's anything you'd like to benchmark in this code; consider marking it as suggested here:http://www.wilmott.com/messageview.cfm? ... E=3#587310
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