• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Which programming language for faster optimization and iterative processes?

JJH

Joined
12/1/10
Messages
24
Points
11
I am currently using statistical programming languages, such as R, for optimization processes. The problem is, R and the like can be deadly slow when it comes to for-loops and iterative processes. Is C++ the best language when it comes to speed and performing loops? In general, what is the best (fastest) programming language for performing heavy iterative calculations?
 
The answer to this really depends on what you want to do. If your issue really is all about an iterative loop taking too long then C++ will do you just fine (and is the standard in finance for this sort of thing). I'd hazard a guess, however, and bet that your time issues are due to something else. I wouldn't try to prematurely optimize based on language alone, is what I am trying to say.

Side note. The BEST thing is hand crafted assembly. Though, to be honest, the compilers can, more likely, write better assembly then you can (then certainly I can!).
 
I'll add another question regarding C++:

What about matrix algebra and basic statistical concepts, C++ doesn't include these? Does that mean that I would have to first teach the program how to multiple and invert matrices and then go on to write the optimization part?
 
"I am currently using statistical programming languages, such as R, for optimization processes. The problem is, R and the like can be deadly slow when it comes to for-loops and iterative processes. Is C++ the best language when it comes to speed and performing loops? In general, what is the best (fastest) programming language for performing heavy iterative calculations? "

Do you want to write your own optimiser or do you just want to use a fast optimizer _package_?
And which kind of optimising are you interested in?

BTW Boost won't be all that useful, apart from some matrices and BLAS operations. The rest is not in there.

BTW the fastest language is FORTRAN.

[q]What about matrix algebra and basic statistical concepts, C++ doesn't include these? Does that mean that I would have to first teach the program how to multiple and invert matrices and then go on to write the optimization part? [/q]

Yup. And the crucial question: how is your C++ knowledge a) < 1 year etc.?

For statistics, see Boost

http://www.quantnet.com/cplusplus-statistical-distributions-boost/
<!-- / message --><!-- / message -->
 
Back
Top