Thursday, October 27, 2011

Correlation doesn't mean easy prediction

Chart: WIG20 futures vs S&P500 futures over 10 years, stooq.com

The Polish and the US stock markets are undeniably connected, which is visible on the above chart, showing performance of the WIG20 futures against the S&P500 futures over 10 years (the realized correlation over the period is 0.7091).

However it doesn't mean that you can use this connection to predict short time price movements - the correlation between previous day change in the S&P500 futures and the current day WIG20 futures change is just 0.1380.

Since for the gaps between the closing on the previous day and the opening on the current you are unable to "catch" the whole daily change of the WIG20, the better value to compare is the change from the opening till close. In this case, the correlation with S&P500 futures changes to -0.1273 (minus).

> fw20c[1:10,]
         Date Open High  Low Close Volume OpenInt     D_Change     OC_Change
3  2000-01-05 1827 1839 1807  1811   5172    4694 -0.019683522 -0.0087960985
4  2000-01-06 1802 1849 1784  1848   5220    4801  0.020224794  0.0252068140
5  2000-01-07 1936 1998 1935  1982   5671    4918  0.070002463  0.0234824471
7  2000-01-11 2010 2070 1950  2042   5990    5622 -0.020359404  0.0157949977
8  2000-01-12 2015 2044 2010  2030   4312    5917 -0.005893927  0.0074165977
9  2000-01-13 2110 2148 2093  2135   5174    6033  0.050430854  0.0117786992
10 2000-01-14 2080 2137 2075  2115   5024    5716 -0.009411834  0.0166869188
13 2000-01-19 2035 2044 2005  2036   5719    5936 -0.005388208  0.0004912798
14 2000-01-20 2058 2068 2007  2053   5975    5839  0.008315039 -0.0024324994
15 2000-01-21 2043 2077 2043  2071   3672    6266  0.008729444  0.0136122666
(...)
> esfc[1:10,]
         Date    Open    High     Low   Close Volume OpenInt     D_Change
2  2000-01-04 1467.00 1468.75 1409.50 1411.75  61942   13967 -0.038218999
3  2000-01-05 1411.50 1427.25 1385.00 1413.50  64049   13007  0.001238829
4  2000-01-06 1411.00 1426.25 1395.75 1404.00  73127   13870 -0.006743593
6  2000-01-10 1459.75 1481.00 1455.25 1475.00  60548   15339  0.009879147
7  2000-01-11 1473.75 1475.00 1447.00 1454.25  59343   16080 -0.014167686
8  2000-01-12 1453.50 1459.50 1438.75 1442.00  70097   16982 -0.008459265
9  2000-01-13 1441.50 1466.75 1441.25 1458.50  62509   16832  0.011377471
11 2000-01-18 1478.00 1480.25 1462.00 1469.50  57421   16106 -0.005767616
12 2000-01-19 1468.75 1474.00 1450.25 1472.50  65454   16859  0.002039430
13 2000-01-20 1472.75 1485.00 1448.00 1457.00  57788   18126 -0.010582109
(...)
> cor(esfc$D_Change,fw20c$D_Change)
[1] 0.1380338
> cor(esfc$D_Change,fw20c$OC_Change)
[1] -0.1273032
> cor(fw20c$D_Change,fw20c$OC_Change)
[1] 0.8551321



Tuesday, October 25, 2011

Cointegrated drunk and her dog visualized

Chart: Drunk and Her Dog

I was reading today an article about cointegration, written by Michael P. Murray. It describes a case of a random walking drunk accompanied by an unleashed dog. Occasionally the dog barks or the drunk calls the dog, and they try to get a little closer to each other based on the sounds.

I thought it may be interesting to visualize the process. You can see the result above :)

The drunk and her dog start at the position [0,0]. Their final positions (in this case after 100,000 moves by each) are indicated by the crossings of the green - for the drunk - and blue - for the dog - lines.

There are three parameters to set: the number of steps, the frequency of either dog barking or the drunk calling the dog, and the efficiency of the correction mechanism, i.e. how much they can reduce distance between themselves on each occasion they try to get closer, and how precisely they can set the course toward each other (the angel).

Although trajectories of both the drunk and the dog follow the random walk:


They are highly correlated:

> cor(drunk_path[,1],dog_path[,1])
[1] 0.9951132
> cor(drunk_path[,2],dog_path[,2])
[1] 0.9937595


And the distance between them is a stationary process:


> mean(distance);sd(distance)
[1] 8.948513
[1] 6.242085

You can decrease the correlation of the cointegrated processes by manipulating the frequency of error correction and precision of the correction mechanism - see parameters mentioned above.

Friday, October 7, 2011

Eat this Berkshire Hathaway ;)

Chart: Danaher Corp. vs Berkshire Hathaway & S&P500

Since June 1990, stock price of Warren Buffet's Berkshire Hathaway was growing on average by 13.5% annually. As a result Berkshire shares rose by 1435% versus just 218% for S&P500. Pretty good, isn't it?

Yes, but you can find companies that dared significantly better. One of them is Danaher Corporation - a conglomerate of various industrial and technological companies - that grew by 2961% over the same period.

Its performance is equally impressive over a much longer period of nearly 33 years - 37093% in total or 19.3% annually versus 1100% for S&P500.


Sunday, October 2, 2011

Highly distorted prices of long term BofA call options


There is something funny going on with the long term out-of-the-money call options on Bank of America. And its not a typical example of the "volatility smile" ;)

$1.00 calls for December 2013 were trading (lightly) at $0.08 on Friday. According to Black-Scholes formula, a theoretical value of such option is $5.12.

At the same time, $1.00 calls for December 2014, were quoted at $0.36, although there were no transactions.

Saturday, October 1, 2011

If you cannot save it, dump it

Chart: S&P 500 Heatmap 2011-09-30; finviz.com

Nobody was willing to window dress on the last day of September. S&P500 index felt 2.5% on Friday. Futures were down even more - 3.13%. S&P500 is down 7.2% for September and 14.3% for the quarter.

Maybe I'm too optimistic, but I'd assume that at least some money managers decided that if they couldn't improve their quarterly numbers it might be better for them to sink even more to lower the baseline for the next quarter.

Many investors believe that S&P500 currently is at the critical technical level and either it will defend it or sharply go down. Some of the most pessimistic analysts even see the 400 level...

Definitely there are reasons to worry about the prospects of the global economy and hence stock prices. As mentioned in the previous posts, investors are highly divided, which leads to high volatility.

Two key factors affect the markets: dragging crisis in Europe and fears about the economy. Since we shouldn't expect resolutions to these problems soon, the volatility will most probably continue. More panic sell outs are likely.

Nevertheless, I'd not expect the Greek crisis to transform into another Lehman crash, even if Greece defaults. The Greek debt is much smaller than Lehman's assets, it has different characteristic, and the parties involved had plenty of time to prepare.

In the meantime, the economic data are mixed, with weak confidence readings overshadowing some signals of slow improvements.

On October 11th, the Q3 earning season begins. The company earnings may be a little better than expected.  Provided that none catastrophic event materializes, there is a chance markets will raise. Although I'd not aim at the 1450 level at the end of the year as some analysts...