Saturday, May 9, 2009

Learning Matlab: Installation

After reading Ernie Chan's "Quantitative Trading" I became interested in MatLab as a way to develop new trading systems to diversify my trading approaches. Today I have a java application that reads in InteractiveBroker statements and does simple MonteCarlo tests. I would like to move all of these simple risk measurement functions to MatLab.

Priced at $1000 MatLab seemed to need more consideration. An open source alternative called Octave looked like it would do everything I want and cost nothing. The Octave developers have worked to make

Octave completely equilivent to MatLab. It seems, from reading forum posts, that Octave is almost compatible and that most script files developed in MatLab will run on Octave. But, not all Octave scripts will run on MatLab because Octave has many additional commands that do not exist in MatLab. Octave has also been reported to be much slower than MatLab, for me this is not important.

I will use Ubuntu as all new software development is free of anything related to Microsoft. This is mostly because of an intense dislike for Windows anything. The decision is made easier as Ubuntu runs my InteractiveBroker and custom trading apps with no problem.

Step 1: I downloaded "Octave", "gnuplot" and 'QtOctave' using the Ubuntu Package Manager and had them running within minutes without a single configuration change. Very nice.

Step 2: Study - I ordered 'MatLab Dymistified' from Amazon (because it was the cheapest MatLab book...). Then discovered the very complete Octave tutorial at: http://wiki.aims.ac.za/mediawiki/index.php/Octave:Getting_started

Save yourself some money - the free tutorial is better than the book....

Step 3: Script Compatibility - try some of the scripts from Chan's book and in the public domain....

Friday, May 1, 2009

Irrational Behavior in the Markets

Prof. Daniel Kahneman received a Nobel Prize in Economics for his work on irrational decision making. I have seen him in interviews tell his often repeated story of the 'map':


"But the story Kahneman recalls when asked about the economic models at the root of the current financial crisis is actually taken from history, not an experiment. It concerns a group of Swiss soldiers who set out on a long navigation exercise in the Alps. The weather was severe and they got lost. After several days, with their desperation mounting, one of the men suddenly realized he had a map of the region.

They followed the map and managed to reach a town. When they returned to base and their commanding officer asked how they had made their way back, they replied, "We suddenly found a map." The officer looked at the map and said, "You found a map, all right, but it's not of the Alps, it's of the Pyrenees."

According to Kahneman, the moral of the story is that some of our economic models, perhaps those of the investment world, are worthless. But individual investors need security - maps of the Pyrenees - even if they are, in effect, worthless."

Ok, fine. but there must be some way to measure the relative worthlessness of a economic model.... If there was you would think that a Nobel prize winner would know how to do so.


You can read a very good interview with Kahneman at: http://www.haaretz.com/hasen/spages/1077151.html