Random Gym Lockers

I joked in the gym locker room this evening with a guy how Murphys Law will ensure that when you are changing and there are tons of free lockers in our section he will have his kit in the locker next to me.

The point of this post is that while it feels like it happens pretty often the truth is it is nothing more than random coincidence and all the times it doesn’t happen these occurrences simply go unnoticed. I think due to the inconvenience and the invasion of space especially when dangly bits are out in the open we tend to notice the times when the lockers are next to each other and because they make an impact it feels more often than random.

This is precisely what happens in the market place. Certain setups make a stronger impact on us and this impact leads us to believe that we have identified a new trend.

I am a very statistically aware person and I feel the jar when I observe people make these misguided statements. What is even more jarring is when I observe myself make these same mistakes. 😤

Sleeping Beauty

I have been wanting to write something inspired about the markets but I have very little to say as frankly I feel like my emotional tank is running on reserves. I want to write something personal before making a simple but fundamental comment about the way to successful investing.

Yesterday I saw this post on Facebook which couldn’t have been more appropriate as we were admitting my 15yr old daughter into hospital for chronic fatigue syndrome and fibromyalgia. For those not familiar how debilitating this condition can be; over the last 5 months my daughter has been sleeping 20hrs a day fighting pain 24/7. Her life has simply been put on hold. No school, no socializing, no fun, frankly no life. For a parent to watch helplessly on the sidelines is one of life’s real challenges.


The message I wish to draw from this difficult experience is simply that in life some of the most important principles are so basic that we tend to ignore their importance.

Watching my Sleeping Beauty sleep hour after hour I am realizing how precious every moment every experience is. When someone is denied something so basic as going to school, going out with friends, walking around without pain then we realize how blessed we are when we can do the basic things in life and how for granted we take these blessings.

It almost feels inappropriate to discuss the markets in the same context of this message but I feel we have lost our way when it comes to investing. If you think you are investing when you buy and sell shares on the market you are probably following some misguided belief. At the end of the day investing is about buying the market when its cheap and selling when its expensive. Do you get any simpler than that?

Norbert Keimling from StarCapital put some nice charts together using the CAPE (cyclically adjusted price-earning) ratio, otherwise known as the Shiller PE ratio to measure whether a market is cheap or expensive.

What you see is that the cheaper the market is in when you invest the better your future returns will be. The markets are breaking to new nominal highs, and the US is at its 2nd most expensive point in its history using CAPE, so you decide whether now is a good time to be investing in the markets.

2015-02-23_0844 2015-02-23_0843

Alpha Stable Distributions

I am doing some work with return distributions. In a previous gig we did a lot of work on this subject, and I was really encouraged by the track of work we were following.

A quick recap: we know that trading returns do not typically follow a normal Gaussian distribution path, yet most of the models in modern day finance still use these less than perfect solutions. Its typical human nature, the solutions give us a nice elegant quick solution most of the time. Because a more accurate solution is more difficult to figure out we rather dismiss the facts that bad things happen more often than we anticipate in the name of progress.

We were determined to find a more realistic solution, in keeping with my previous post, keeping it real 🙂 .

In the 2 charts I am going to illustrate how our most likely estimate (MLE) model using Alpha Stable Levy distributions does a much better job than the blue line normal distribution model.

fitted distribution

fitted distribution 2

Quantitative Ramblings

This post is an opportunity to play with a few ideas buzzing in my head this afternoon.

Here is some data on the hedge fund industry taking from the EDHEC dataset. See website for more details: http://www.edhec-risk.com/

Here is an overview of monthly performance from 1 Jan 1997 – 31 Dec 2014.



On a risk adjusted basis the Equity Market Neutral returns are the clear star performer.






Now let us have a look at how some of these returns look from the lens of a normal distribution.

Rplot16 Rplot15 Rplot14 Rplot13





There is a very strong argument that the markets are random. If this is the case then fund managers should not be able to demonstrate any consistent pattern of returns. One of the ways to determine if there is a persistence of performance is to test for auto-correlation. In essence auto-correlation is a process whereby you test the correlation of a time series by itself but create a series of lags. Naturally the 0 lag will have a perfect correlation of 1 (100%) what you are looking to see is if the lags produce a statistically significant correlation by piercing the horizontal dashed lines. If there is a  statistically significant auto-correlation after many lags, I think we can dismiss this as spurious we are looking for significance after few lags.

I wasn’t surprised to find that the only strategy to produce auto-correlation was the Equity Market Neutral strategy.  L/S Equity was also able to produce auto-correlation.


Rplot18 Rplot19 Rplot20


To conclude this post is just me rambling along while watching some news. I will do more in depth analysis some time in the future but I think from the data presented there is certainly a strong argument to be made for managers that try and take out market direction in their trading behaviour. I think this makes a lot of sense, if forecasting the markets is random as many suggest, then the best chance of producing alpha as a manager is if you see the investing world within the relative scope of a market neutral environment.


Volatility Clustering

In case you thought volatility is isolated, the charts below give you an idea of how volatility leads to more volatility – duh! Knowing this doesn’t license you to print money, life would be way too boring if that was the case. The problem is not knowing that volatility cluster it is that we have no idea how long we will stay in a low or high volatility environment and its amplitude. In essence the billion dollar question is identifying when an environment regime shifts.

There is a ton of research in this area, and I have to confess I am attracted to the hidden Markov chain process in the shorter time horizons. Later in the year I hope to share some of my research into this subject. Let’s get back to the clustering:

In the top chart I look at the S&P500 on a rolling 100 days with 2% or more moves, and the bottom chart shows the Shanghai Stock Index which took a 7% bath yesterday, and with GDP numbers coming out later today promises to provide further fireworks. What I can say about the comparative 2 charts is that China is starting to look like its entering a more volatile period ahead of the US.

For those interested in the R code I have included it as well. (Hat tip to John Hussman for the graphic idea, I wish my code were more elegant, but I think it does the job, ignore the errors about my labelling).



Shanghai Stock Index

Shanghai Stock Index

#get the data
getSymbols('^SSEC', from='1990-01-01')
#lets look at it from 1990 to 2015
#spy <- SPY['1990/2015']
Shang<- SSEC['1990/2015']
#our baseline, unfiltered results
ret <- ROC(Cl(Shang)) 
#our comparision, filtered result
filter.d <- Lag(ifelse(ret < -0.02, 1, 0))
drops<- rollapply(filter.d==1,100,sum)
filter.g <- Lag(ifelse(ret < 0.02, 1, 0))
gain<- rollapply(filter.g==1,100,sum)
plot(drops, main = "Drop and Gain Clustering", sub = "sum of 2% movements over 100 prior days", ylab ="drops")
plot(gain, main = "Drop and Gain Clustering", labels = FALSE, col = "red")
axis(side =4)
mtext("gains", side = 4)

Created by Pretty R at inside-R.org