Python Visualization of the Financial Crisis
I came across Reginald Smith's “Epidemiology” of the Credit Crisis (DRAFT) via Vitorino Ramos' Chemoton blog. A picture is worth a thousand words, a movie even more.
By the way Chemoton is very interesting, it talks about Artificial Intelligence, Artificial Life, Complexity, Evolutionary Computation, Economy, Finance, Swarms, etc, all topics I am interested in.
Reginald Smith's visualization is obtained by constructing a minimal spanning tree using Python Graph and animate using Graphiz and Pydot modules.
Data used are S&P 500 and NASDAQ-100 stocks, between Aug 1, 2007 and October 10, 2008.
The nodes are the stocks. The links are basically correlation coefficients between 2 stocks, modified to make it satisfy a distance metric. A log function of the closing prices is taken before the correlation is calculated.
Color codes used: green means return greater than -10%, yellow means return between -10% and -25%, and red means return greater than -25%. The return is the cumulative return since Aug 1, 2007.
Here are 4 snapshots taken on Aug 9 1007, Nov 12 2007, March 14 2008 when Bear Stearns collapsed, and Oct 10 2008 (all images from the original paper).
Smith cautions that correlation links are statistical and not causal links.
It might be interesting to see a similar visualization for World Financial Market as the crisis has spread geographically.
When the bottom is reached, we could have a visualization of the recovery process. This could be a long wait.
Finally, using copulas instead of traditional correlation coefficients would be more accurate, but the computing task would be huge.





1 komentar:
I recently came accross your blog and have been reading along. I thought I would leave my first comment. I dont know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
Ann
http://externallaptop.net
Post a Comment