As part of an effort to investigate price regimes, I decided to try some simple tests of randomness in price series.
In this first exercise, I simply look at the direction of price change from one period to the next and seek to identify if the frequency of up and down days (Count) and the frequency of direction changes (Runs) are significantly different from a coin toss.
Z-Score of Counts
I decomposed 40 price series to a series of 1’s, -1’s and 0s. I ignore the 0’s leaving a shortened prices series of 1’s and -1’s: “Moves”. If the series has length N then we can calculate a z-score for the Count of Moves:
where xi is the series of price moves.
If the distribution of z-scores is not normal (as the central limit theorem says it should be) we can conclude the balance of up and down days in these price series is unlikely to be the product of a random process.
The distribution is clearly skewed to the right – maybe the effect of inflation. On the left extreme we find Wheat, Lumber and the Yen. On the right extreme we find Libor, US Notes and US Bonds; Australian dollar and Mexican peso; S&P 500 and Nasdaq; crude, gasoline, silver and platinum.
It is interesting that we find high concentrations of assets over which the government can arguably exert some influence (interest rates and currencies).
Z-Score of Runs
Using the same “Moves” I investigated the number of runs of 1’s and -1’s. I employed the Wald-Wolfowitz Test. If Nplus is the number of upmoves, Nminus is the number of down moves, N is the total number of moves (Nplus + Nminus) and Runs is the observed number of runs. Then the expected number of runs in a sample and standard deviation of a random series is:
If the distribution of z-scores is not normal (as the central limit theorem says it should be) we can conclude that the runs of up and down days (regardless of their numerical imbalance) are unlikely to be the product of a random process.
Here we find a wide spread of z-scores with fat tails – not what you would expect from a random process.
On the left where there are long series of same-direction moves (and thus fewer runs than you would expect), we find Libor, 3mo Eurodollar, US Bonds and palladium. On the right (where the series of moves are un-naturally short) we find: US$, Swiss and Euro; S&P; silver, copper, cocoa, coffee, wheat, soy beans, lean hogs, cotton.
Once again we seem to find interest rates and currencies featuring.
Bear in mind there is no analysis of the size of daily moves, just direction. Nor is there any analysis across time (coming later).
I find it intriguing that there seems to be, in general, a strong tendency for there to be more runs than expected (they are shorter). I had expected the opposite.
I find it interesting how frequently interest rates featured at the extremes – all 4 made one extreme and 2 of 4 made extremes on both tests. This may be related to government influence on these markets.
To a lesser extent, currencies also featured at the extremes – of 8 currencies, 6 appeared at one or other extreme. Perhaps this is a weaker effect of government intervention in interest rates.
I plan on investigating the use of these tests as a filter to classify price series as: trending (maybe: count imbalance + low number of runs), reverting (maybe: high number of runs) or noisy. This will require analysis in the time dimension.