Learning C++ or Matlab from scratch
October 20, 2009 12:11 PM   Subscribe

Is it possible to learn C++ or matlab for financial engineering without a strong background in math or previous experience in computer science or engineering? Any advice would be appreciated.
posted by jsmith78 to Computers & Internet (14 answers total)
 
C++ has a relatively high learning curve. Go for Matlab or Python. Even Java is easier to learn than C++.
posted by qxntpqbbbqxl at 12:17 PM on October 20, 2009 [1 favorite]


Sure, if you've got 6 months with nothing else to do.
posted by GuyZero at 12:21 PM on October 20, 2009


Sure, it's possible if you put enough effort into it. This is kind of a hard question to answer since we don't have much to go off of here. You say you don't have a strong background in math; does that mean you don't have much background in financial maths? How much C++ or Matlab do you already know? If you don't know any financial math or basic programming, you should probably learn that first before you try to code up financial applications.

At any rate, look into Mark Joshi's book C++ Design Patterns and Derivative Pricing. Matlab is pretty easy to pick up by yourself, but Paolo Brandimarte's book Numerical methods in Finance and Economics: A MATLAB-based introduction has tons of examples for you to work from.

And please note that the Joshi book is certainly not for a beginner in C++; you'll have to pick up a good book to learn the basics if you aren't familiar with it. And obviously neither of those books will be useful if you aren't familiar with the basics of financial maths already.
posted by pravit at 12:22 PM on October 20, 2009


Yes, and go for Matlab. It is a lot more forgiving and easier to get into than an independent programming language, since you can start using it right off the bat without worrying about compilation, programming environments, etc. Any self-teaching book will be able to impart the fundamentals, and you will usually be able to get the rest from Matlab documentation and knowledge bases. It's also a great introduction to programming in general.
posted by Behemoth at 1:00 PM on October 20, 2009


You can definitely learn C++ without a background in computer science. I'm not so sure it will be particularly easy. As others have said, Matlab will be easier to get going with. There is a lot of infrastructure that needs to be sorted out when you start programming (building and linking and all of that junk). Matlab is all self-contained. I'm not sure what a good introduction to C++ would be, but the best book about C++ is The C++ Programming Language by Stroustrup.
posted by chunking express at 1:58 PM on October 20, 2009


Matlab is very easy and you can get the basics within a few hours. There are dozens of tutorials out there on the internet. Data visualization (i.e. making graphs) is also very straightforward. An alternative is Octave, which is free and mostly compatible with basic Matlab syntax. I found that your use of Matlab scales with your knowledge of mathematics. Example: if you're trying to smooth some data and learn about Savitzky Golay filtering, you discover that matlab has an "sgolay" function.

Python and C++ have the same capabilities, but require more investiment in time (and installing all sorts of packages/additions).
posted by swordfishtrombones at 2:14 PM on October 20, 2009


C++ has the harshess learning curve that has ever existed in the history of programming images. It is a monster of a language. The consensus amongst some of the world's greatest hero programmers is that coding in C++ is humbling, as you are constantly reminded of how little of language you really understand.

Java is far easier than C++, though it is no piece of cake either. Both are terrible place where to start learning how to program. You would do much better with Mathlab or Mathematica, but there's much better stuff out there for beginners.

But really at this point the fact that you want to code financial engineering stuff is not relevant. Learning how to program is hard enough. Specific applications can come later. There are a lot of askMe's on how to learn programming, and how to choose which book to learn from. Just follow the recommendations here, here or here.
posted by gmarceau at 2:23 PM on October 20, 2009


Learning C++ would be very, very hard. Can't speak to Matlab.
posted by callmejay at 3:06 PM on October 20, 2009


Learn python. It's much, much more practical than either C++ or Matlab
posted by i_am_a_Jedi at 3:35 PM on October 20, 2009


I learned C++ in compsci classes, with not a great math background. Nice to hear that others found the learning curve difficult. I couldn't/wouldn't have done it on my own, but it wasn't impossible.
posted by theora55 at 3:51 PM on October 20, 2009


Best answer: I don't know about financial engineering, but I know about programming and math. Don't learn C++ just because you need to write a program to compute something. Learn C++ only for things that really require C++. Some people would argue that there aren't any.

You could try plain C if you need a really low-level language, since it has most of the advantages of C++ without all the complexity. Python is a sensible general-purpose language that's easy to learn. But if you need to do a lot of math, nothing beats MATLAB--the syntax is bit odd, but it makes nearly any kind of calculation fast and simple.

For programming itself, you don't need real math very often—but it's very helpful to have when you do need it. In particular, it's important to know how fast your program (or a part of it) will run, or how much memory it will use, as a function of the size of the input. This often requires some discrete math, which you could learn from a book on algorithms or data structures.

I would do it in this order: first learn the basics of programming, in whatever language you like (this requires hardly any math). Then learn some discrete math along with basic data structures, which you will need to know about in order to write good programs. Finally, just practice a lot, and keep looking things up when you need to, and eventually you'll be good at programming.
posted by k. at 7:26 PM on October 20, 2009


matlab has it quirks. However, once you learn your way round it's a good place to get your learn on.

The fact that the matrix is the base data structure is handy. Some of the problems in finance and economics (portfolio optimization, risk management) are more easily expressed with matrices.

I had a similar experience to behemoth, matlab allowed me to get started right away without having to content with compilation, debugging, etc. In fact, when I started out, I used it interactively almost exclusively. This allowed me to experiment with the concepts and formulas helping me improve my understanding of what was going on. There was no programming barrier between me and the math so to speak.

As a side point, the interactive mode extends to interacting with objects. You can instantiate java, .net and c++ objects on the command line -- useful if you want to play around with or test out the free libraries that are out there.

behemoth also mentioned the community -- since matlab is common in academia, you can usually find code snippets (sometimes whole libraries) associated with books, classes and school projects that you can use to augment your learning.

matlab also sells their own libraries which contain open source implementations of useful functions for statistics, optimization, econometrics and utilities for managing time series and acquiring data from databases or online sources of data. the only problem is those libraries are expensive even if you're buying the academic versions.
posted by cheez-it at 8:01 PM on October 20, 2009


Get Resolver One, and learn Python.
posted by signal at 11:37 AM on October 21, 2009


Matlab is used in the business, when you need to

- develop and try a new code
- solve a unique problem fast
- create detailed and good looking visual presentations
- create a GUI.

Many times the real application is later written by using some other program (C++, VBA etc.), but e.g. C++ is far slower to use when developing new applications for your business.

I have made a decision to learn Matlab and VBA, and skip C++ as we did not become friends...

You can learn Matlab by yourself if you

- understand the mathematics, you will be dealing with
- have logical thinking skills to understand the programing in general.
- have persistence to get started.

I love Matlab now (over VBA), and would not give it away.

Some suggestions:

- Learn to work with HELP and DOCUMENTATION, to solve problems
- If possible participate a basic course to get started with an EXPERIENCED Matlab programmer
- have some good material, in order to learn how the problem solving process will go...

DB
posted by Doggiebreath at 2:38 PM on January 11, 2010


« Older Stories of local and national shennanigans   |   Is there any way to estimate what a car & car... Newer »
This thread is closed to new comments.