KWrite

Rational Evolution

March 31st, 2008

Subprime crisis: heroes and criminals

http://www.kfwimer.com/images/ss-subprime.jpg

The American subprime market meltdown started in the summer 2007 has caused a terrible shock wave effect on the US economy as well as on the world economy. Many financiers and financial institutions cried and blamed at each other for having caused this mess. But who are really the criminals, and maybe *heroes*, during this economic war time?

1. Black Swan Prophecy

Since the fall 2007, it’s very probable that whenever there is a crisis, people will cry out the name Nassim Taleb. The option trader who got his initial fame for pocketing of $35-40 million on the Black Monday (1987) is now even more famous as a best-selling author and as a philosopher of randomness as he calls himself. Since Bloomberg has recently repainted a glamorous picture of Taleb, I have not much more to talk about him.

Originally Posted by Bloomberg

On a freezing day in March 2007, Nassim Taleb walked into a conference room at Morgan Stanley’s Manhattan offices on 47th Street and Broadway to address a group of the firm’s risk managers. His message: Your models don’t work.

Only six months later, Morgan Stanley experienced its own rout. The world’s second-biggest mergers adviser announced in December that it had written down its subprime-related holdings by $9.4 billion after the firm’s traders misjudged how fast and far prices of the debt would fall. Their risk management had failed.

Is Taleb just a regular philosopher of randomness or is he himself an almighty prophet? What makes Black Swan popular may be not the philosophy itself but instead his inexplicable timing, from the 1987 crash to Societe Generale’s huge trade loss to Morgan Stanley’s $9.4 billion writedown (all described in Bloomberg’s article). Note that he published his Black Swan book in May 2007, just a couple of months before the subprime meltdown (which is a Black Swan event according to his theory) began.

It’s quite possible that Taleb is merely obsessed with Black Swans and make black-swan bets on everything. It just happens that when something extremely bad happens, the human reaction makes it even worse than it was typically modeled. That makes Taleb win big on average.

There’s undoubtfully a lot of hype about the guy right now. It’s just hard to decrypt this hype in its full glory. The only lesson we can take for granted from this controversial figure is: don’t be fooled by randomness.

2. The Criminals

Financial modelers (or quants) have recently been placed under strong criticism for the handling of the subprime market, for example as in Daniel Carroll’s article “When Quants Fail”. This is in some sense aligned with the comments of Julian Shaw in How I became a quant. I in fact highly rate Julian’s story out of a bunch of other stories in that same book.

Originally Posted by Daniel Carroll

People just get impressed with complex mathematics, especially when they don’t understand it. As a trained mathematician, I often have a hard time understanding why. I don’t, however, have a hard time understanding why these models fail periodically.

On the other hand, Professor Nicole El Karoui (see also a featured article about her on WSJ) had an interesting interview with Le Monde in which she affirms Mathematics shouldn’t be blamed for the mortgage bubble.

Mathematics and Sciences should never be blamed. The problematic reality is … most of us don’t fully grasp their true spirit. Perhaps more than 90% of mathematical reseach is trash or even totally wrong. In academia, this results in papers with low number of citations and then no one really cares about it. However, in an investment bank, an incomplete model (let alone bullshit models) may be disastrous. With the 1987 crash and the subprime meltdown in the pocket, quants on average may look more like monsters rather than protagonists.

The bigger criminals here of course would include the managers who gave too much power to their quants that are obsessed by and over-confident about their wrong models. Let me end this short discussion by quoting a nice summary of who and what to blame for the subprime crisis, posted on Wilmott:

We have to blame the whole system:

  1. The managers (investors) that followed quants blindly just cos they can really do awesome maths
  2. Central Banks that don’t understand a sh** about financial behavior and are the first to make a mess with the rules
  3. Some Quants that are so arrogant that followed their models blindly just because it had a really nice fit to historical data. so they feel like Gods sometimes until they find they were fooled by randomness
  4. Inputs and assumptions are more important than the mathematical quality of the model (of course this is also important to get the correct outputs)
  5. University degrees in finance are not as well designed as they should be
  6. Lots of people in Banks and Central Banks come from Economy, Engineering, Maths instead of Management and Finance (Management is really under rated nowadays)
  7. People care a lot with complex models instead of looking for simple strategies that can make awesome trades. In management and Finance we say that complexity must me charged with extra fee. What we’re seeing was the opposite though. Complexity were being priced at low cost
  8. Most people like mysticism and don’t believe in their skills. They are willing to put a lot of money in a black box trading algorithm or in a fund instead of investing by themselves
  9. Greedy managers that don’t understand the risk-return trade-off
  10. Trading bonuses which sometimes encourage traders to behave very differently than if they were to invest their personal capital

March 30th, 2008

“Bibles” in Applied Math

Bibles in Applied Math

Awhile ago, I and other VNQF members posted some of the most famous books in Quantitative Finance and related fields (including Partial Differential Equations, Numerical Methods, Optimization, Parallel Computing). Recently, I’ve posted a few classic books in Applied Math, based on the request of a member in the VEF’s VietnamBookDrive project. Even more recently, anh Ngo Quang Hung (and “đồng bọn”) have created a list of great textbooks in Computer Science.

Here, I merely recompose the list of some bible books in Applied Math that I already did, but maybe more in depth and not limited to the scope of VEF. By Applied Math, I mean a wide spectrum from extremely mathematical topics (they’re essentially subsets of “Pure Math”) such as Partial Differential Equations to Computations (Numerical Analysis, Multiscale Modeling,…) to Probabilistic/Statistical Sciences to Computer Science and to a wide range of Applications (Physics, Chemistry, Biology, Engineering, Finance, Economics, Business, Medicines, etc.). Due to the breath and depth of this giant discipline, the list is by no mean complete and will be updated here continuously (possibly until I die).

For some of the books here, I have gone through or half-through or quarter-through. For the rest I haven’t but this doesn’t prevent them from being invaluable sources of reference. Another important note: the words in my description shouldn’t be quantified or taken superficially. For example: if I say something basic, it doesn’t necessarily mean easy stuff (well, may be for researchers in the field) and can be far beyond my understanding.

Read the rest of this entry »

March 27th, 2008

My favorite Firefox plugins

  1. Adblock Plus. Banners/ads on websites all look annoying. In many cases, they take a lot of time to load and can slow down your web browser significantly. Adblock Plus is a solution. It even kills text-based Google ads. Isn’t it nice?
  2. GreaseMonkey. This is actually the most powerful plugin if you’re willing to use it. Very simple, it’s basically a script manager. You can browse already written scripts here and add the ones you like to your GreaseMonkey or you can also write your own script. It is similar to the freeware autohotkeys in a sense.
  3. CustomizeGoogle.
  4. Google Search Keys. If you’re a geek who hates using mouse (or touchpad, trackpoint, etc.) but loves the search engine, you may love this lightweight plugin as well.
  5. Translator. Do you sometimes have to read French/German/Chinese webs? If so, use this plugin.
  6. Google Preview. It simply helps make web search more enjoyable.

What are yours?

March 22nd, 2008

Economics Interview Questions

Well, maybe you haven’t seen some of the following questions at any firm yet, cuz I’m the creator . But I’m sure that they’re well-known in the Economics literature. Anyway, I guarantee these’re interesting questions .

1. Monetary Theory -> Fractional Reserved Banking. Why doesn’t a government put a high minimum reserve-fraction? Let’s suppose that on a good Friday (which is today) the US government decides to set the minimum reserve at 50%. Of course, in doing that, it also needs to either offer more government bonds or print more currency (M0) in order to balance the desired total money in circulation.

What are the pros and cons of this minimum-reserve increasing policy?

[I have my own answer but I'm also looking to see more and better insights.

Here is a couple of hints on Pros:
- There will be less commercial banks. A lot of intellectually qualified bankers will move to other more useful industries, which produce real goods.
- Every existing bank will reduce the risk of having a bank run. Hence, the risk of having a financial crisis or economic recession also decreases.]

2. Wait until next good Friday?

March 15th, 2008

Why iPhone sucks

It really does!

  1. For Windows users, iPhone can only synchronize the contacts and calendar with Outlook (Express). This is very strange because Apple doesn’t seem to be a close friend of Micro$oft.
    • Corollary 1: for non-Outlook users, like me, iPhone is bloody sucky.
    • Corollary 2: even worse, it cannot synchronize with Google Calendar.
    • Conclusion: this limitation is really a big drawback of iPhone. Well, if I was a software engineer, I would have tried to write a patch for iTunes so that it can synchronize with Thunderbird (and Google).
  2. iPhone is not designed for Linux users. Why?
    • [Skip this item if you're not a programmer] As Linux and Mac OS share similar platforms, I was at first surprised why Apple developers don’t spend a few days tuning and compiling an iTunes version for Linux. Let’s dig a bit deeper. As I’ve just learned, while there’re some similarities between the two OS’s kernels, programming in Mac is quite different. Loosely speaking, Apple builds in Mac an object-oriented framework called Cocoa to utilize Mac’s *strengths*. The native language for this framework is Objective-C, which is not quite the same as C++. In one sentence, it’s not that easy to compile the source code of iTunes, written in Objective-C, in Linux.
    • It’s of course as hard or harder to rewrite iTunes for Windows. However, Windows has a much larger market share, which is worth the effort (even when there’s no such thing called iPhone). Moreover, only Windows/Mac users are hyped about the iPhone.
  3. It doesn’t have the push-email feature that Blackberry has. Being said, you have to check your email manually or to set iPhone to check emails periodically (every 15/30/60 minutes), which makes the battery life go down pretty fast.
    • This is the biggest drawback for a lot of users, especially corporate people. Blackberry currently dominates the smart phone market mainly due to this reason. As I’m writing this, Steve Jobs had already announced that push-email will be available on iPhone starting June 2008 [it's an entertaining presentation for iPhone developers].
    • However, frankly said, I don’t care shit about this feature as I would check my emails manually anyway. As a non-corporateman, I find email notifiers very irritating and time wasting.

Don’t get me wrong. That iPhone sucks doesn’t mean other devices don’t. In fact, all available mobile devices are far from being desirable, in one way or another. Weighing all the options, I still place iPhone as the top mobile device. It just has to improve much more to keep its top spot stable.

What struck me is that all the features above can be easily implemented, with some effort, but haven’t found their way to reality yet. I bet they’ll all be available within next year, after Apple releases their iPhone firmware 2.0 in 06/08.

March 14th, 2008

American Irresponsibility

One of the few valuable writings on CNN recently: Too bad, Michigan and Florida.

“What do these stories all have in common?

  • A woman who says she lost more $1 million gambling in Atlantic City sues some casinos for $20 million, claiming they should’ve stopped her compulsive gambling.
  • People who bought houses they couldn’t afford with loans they didn’t understand want their lenders to change the terms.
  • Congress authorizes a war and then tries everything it can think of to get out of it.
  • Our country gets addicted to oil and then blames OPEC when it doesn’t like the price.
  • These stories prove how personal responsibility has all but vanished in America, and our government is leading the way.”

    March 4th, 2008

    The Audacity of Hype

    Not all but 5 typical reasons why “Obama for President” is a joke.

    1. Hypothetical (or “The Audacity of Hype“)
      1. He has no specific plan for the country. You can’t lead a country by hoping. A president has to respond to the ugly reality (which was partly contributed by the Bush administration).
      2. Withdrawing the troops from Iraq immediately without access to intelligence reports is a joke. Withdrawing and then sending them back again if the Al Qaeda is still there is even more hilarious.
      3. “Yes, we can!”? This message is as empty as his agenda.
    2. Misleading.
      1. This is how he responded to Bush and McCain’s saying that the Al Qaeda is in Iraq: “there was no such thing as Al Qaeda in Iraq until George Bush and John McCain decided to invade Iraq“. This guy is more ready to be a historian than to be a president.
      2. The only positive thing about Obama is that he so understands Americans, who applauded really hard for that stupid statement.
      3. He has kept saying that he was against the war on Iraq from the beginning. Well, he wasn’t even in the senate during the time. He had no right/obligation to vote. And more importantly, he wasn’t feeded the intelligence reports. Any of such judgments, right or wrong, is thus immature. Should Americans risk their national security on a gambling table?
      4. Mr. Obama constantly criticizes the politicians in Washington [for serving interest groups rather than the country]. He is, however, a real typical politician, thanks to his charming but empty rhetoric.
    3. Not serving the country. What has he done in the last few years as a senator? campaigning real hard for his presidential race. Search “Obama missing in actions” for more news coverage.
    4. Lack of experience. Experience does matter and matters a lot in making good judgments. Talking repeatedly about good judgments in handling national crises with an empty track record is purely vain.
    5. Radical. A radical candidate, either too liberal or too conservative, may win his respective primary but will hardly get elected to the white house. It’s what Richard Nixon figuratively said.

    March 2nd, 2008

    Programming Tips (C++)

    Since I’ve been back coding for the last few days, I’d like to save some useful programming tips that I’ve just figured out.

    1. Linear Algebra package: use uBlas. uBlas, developped by Boost, is very object-oriented and easy to use. Not only does it support linear algebra, it also nicely supports sparse matrix storage and processing, which is important for iterative methods (when solving PDEs by Finite Difference or Finite Element). Take a look at my little program below, which constructs a sparse matrix when solving a boundary value problem.

    Code:

    #include <boost/numeric/ublas/vector.hpp>
    
    #include <boost/numeric/ublas/matrix_sparse.hpp>
    
    using namespace std;
    
    namespace ublas = boost::numeric::ublas;const int N = 5000; // number of discretizations on each direction
    
    typedef ublas::vector<double> Vector;
    
    typedef ublas::compressed_matrix<double> Matrix; // Sparse Matrix class
    
    void initializeMatrix(Matrix& A) {
    
        long k=0;
    
        for (int i=0; i<N; i++)
    
            for (int j=0; j<N; j++) {
    
                A(k,k) = -4;
    
                // adjacent elements in x-direction
    
                if (i>0) A(k,k-N)=1;
    
                if (i<N-1)
    
                    if (i==0) A(k,k+N)=2; // Neumann condition on this side
    
                    else A(k,k+N)=1; //Dirichlet condition on this side
    
                // adjacent elements in y-direction
    
                if (j>0) A(k,k-1)=1;
    
                if (j<N-1)
    
                    if (j==0) A(k,k+1)=2; // Neumann condition
    
                    else A(k,k+1)=1; // Dirichlet condition
    
    k++;
    
            }
    
    }

    Drawbacks of uBlas

    • It has poor performance compared to (atlas-)Blas. One reason is that it is the most abstract linear algebra library (easier to use). Another critical reason is that it performs many *useful* (debugging) checks. The performance issue can be overcome through some optimization tricks, such as one that I described in the compiler section. Check out the effective uBlas wiki page for more performance tips. If performance is critical, consider binding with Atlas.
    • Poor documentation: if you’re used to Java’s API (which is terrific) as I was, using uBlas as first may be difficult because uBlas’s documentation is, now, quite short and lacks many details. The developers are working hard on it though. Moreover, they also maintain a main mailing list (and some other satellite sites) where you can ask questions.

    2. Quant Finance Library: use QuantLib, the major open-source library

    3. Compiler: when finished with your programming/debugging, consider using -O3 and -DNDEBUG for a much better performance (thanks to Tuyen). Most of the time, it optimizes the program significantly. Below is an illustration.

    Code:

    [khoa@trinidad]$ g++ myProg.cpp -o myProg
    
    [khoa@trinidad]$ ./myProg
    
    Total time: 68.74 seconds
    
    [khoa@trinidad]$ g++ -DNDEBUG myProg.cpp -o myProg
    
    [khoa@trinidad]$ ./myProg
    
    Total time: 49.43 seconds
    
    [khoa@trinidad courses]$ g++ -O3 myProg.cpp -o myProg
    
    [khoa@trinidad courses]$ ./myProg
    
    Total time: 13.9 seconds
    
    [khoa@trinidad]$ g++ -O3 -DNDEBUG myProg.cpp -o myProg
    
    [khoa@trinidad]$ ./myProg
    
    Total time: 11.54 seconds

    |