Ali’s blog

Mostly quant stuff with occasional digressions

Matlab, Scilab, Octave

Posted by alifinmath on March 4, 2008

These are some random thoughts I have on Matlab and Matlab clones: I haven’t bothered to structure them.

One of my pet peeves is the lack of a proper manual for Matlab. There are many books out there on this package and how to use it for different purposes (statistics, finance, numerical analysis), but they all cover the same basic features of Matlab. Unlike C# or Visual Basic, there is no text or reference manual out there that covers the sophisticated features of Matlab 7. The company behind Matlab — Mathworks — hasn’t bothered producing one. People like myself prefer to look at books, not wander back and forth on help screens. This omission is inexcusable on the part of Mathworks. However, help is at hand — to a limited extent. Octave is a (free!) Matlab clone whose reference manual can be used to learn Matlab features. The problem is it’s not available as a PDF, and it’s difficult to print out 575 pages of HTML. The hardcopy version, available at Amazon, is dated 2002, and doesn’t cover the latest features.

Another free piece of software is Scilab. It’s not quite the clone Octave is — but it’s close. Over the weekend I picked up Modeling and Simulation in Scilab/Scicos, by Campbell, et al. It’s one of the few books available on this (free) package. I’m still looking at it and will accordingly refrain from judgement, but so far it’s a well-written book.

With regard to the literature on numerical methods using Matlab, I see a handful of books available. I’ll briefly discuss the three I have with the caveat that others on the market may be as good, if not better, than the ones I have. Before I forget, I’m still waiting for Fusai and Roncoroni’s Implementing Models in Quantitative Finance (been waiting five months in fact): this is a Matlab-based text.

For financial engineer wannabes, the single best book is Brandimarte’s Numerical Methods in Finance and Economics. It would be ideal for a leisurely 2-semester course in numerical methods for financial engineers (and I do stress leisurely: all financial engineering students seem to get exposed to is frantic and incomplete crash courses). It’s a beautiful book from which a diligent student can learn not only numerical methods for ODEs and PDEs, but also some basic finance and Monte Carlo.

For just numerical analysis, a well-written text is Quateroni and Saleri’s Scientific Computing with Matlab and Octave: (2nd edition). 318 pages cover both the rudiments of Matlab and the contents of a standard undergraduate first course in numerical analysis: linear and nonlinear equations, differentiation and integration, ODEs, and a final chapter devoted to PDEs (finite element methods). Another beautiful book that isn’t afflicted with redundant verbosity (the bane of undergrad American texts). I also appreciate the fact that the authors have tried to explain how to implement the algorithms in Octave in those situations where it differs subtly from Matlab. And finally, I appreciate the candour: at the end of every chapter is a section titled, “What we haven’t told you”;  for the last chapter, the authors state: “We could simply say that we have told you almost nothing, since the field of numerical analysis which is devoted to the numerical approximation of PDEs is so broad and multifaceted to deserve an entire monograph simply for addressing the most essential concepts.” The book is going for a paltry $42.

Finally, for a slightly more comprehensive treatment, there’s Fausett’s Applied Numerical Analysis Using Matlab (2nd edition). This is all of 673 pages and going for a whopping $127 (but I managed to pick up a new copy for about $70 a few months back). There’s more material than in the previous book — mostly with regard to ODEs but also a bit more on PDEs. Caveat: neither this book nor the previous ones can be used as texts on theoretical numerical analysis: they will not explain why certain methods work, or error rates, or speeds of convergence.


2 Responses to “Matlab, Scilab, Octave”

  1. Chris Prouty said

    Octave is generally good, but it is inadequate for simulation in my experience. The same Monte Carlo simulator that executes in 10 seconds in MATLAB takes 10 minutes in Octave. Give it a try with the example code I have posted in my lecture on Monte Carlo in MATLAB.

  2. Don said

    Thanks for the books links

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: