Wednesday, July 16, 2008

Illustration of Why Predicting Stock Market Direction Is Futile

Randomness:"I returned, and saw under the sun, that the race is not to the swift, nor the battle to the strong, neither yet bread to the wise, nor yet riches to men of understanding, nor yet favour to men of skill; but time and chance happeneth to them all."~~Ecclesiastes 9:11
Non-linear Feedback Loops: “I tell you everyone who has, shall more be given, but from him who has nothing, even what he has shall be taken.” ~~Matthew 25:29
Cycles:"When the seven years of abundance enjoyed by the land of Egypt came to an end, the seven years of famine set in.."~~ Genesis 41:53/54
1. I-Dimensional Continuous Wavelet Transform of SP500 January 06-July 08


2. S&P500 Weekly Data: Jan 2006 to July 09 2008 (133 data points)


3. Wavelet-based Synthesized Time Series Example A


4. Wavelet-based Synthesized Time Series Example B


5. Wavelet-based Synthesized Time Series Example C

The reason why the stock market's direction (as represented by an Index) cannot be predicted is because the time series contains a random as well as a deterministic component. The random component by its very definition cannot be predicted. The deterministic component is subject to all sorts of non-linear forces and feedback loops that cause very small initial differences to explode exponentially. For example we might be using a parameter rounded to only two decimal places, when even small differences in the fourth or fifth decimal places in the computer's initialization of calculation can cause widely diverging results.

This is illustrated with the images 3 to 5 above. Image2 is a real 133 data points time series-the weekly Close of the S&P500 from Jan 2006 to July 09 2008. Images 3,4,5 are three sets of time series generated with the same algorithm, using the same parameters. From examples A, B and C you can see that each 'run' of the algorithm produced very different end results. If this were the real S&P500, we could be in any of the situations A,B ,C and anything in between. But don't the artificially generated time series look eerily similar to the real data?

* I do have some qualifications and clarifications to make about the non-predictability of stock market direction: (1) During some periods, predictability for very short time frame can be to a degree such that it is useful for trading. Some very short -term (intra-day) programs for FOREX have proven to be profitable as shown in studies by Dr. Richard Olsen, founder of Oanda.com (2) Some stocks have good mathematical characteristics for predictability e.g. having returns cycles which are distinctive and regular. (3) You don't have to predict the level of the market, predicting changes in volatility will do-and this is much easier to do.

About the Algorithm
The synthesized series above are much more realistic than earlier generation attempts using simplistic random number generators. Our time series were generated using Wavelet-based Fractional Brownian Motion Synthesis. * see Notes on Wavelets below. It was proposed by Abry and Sellan in Abry, P.; F. Sellan (1996), "The wavelet-based synthesis for the fractional Brownian motion proposed by F. Sellan and Y. Meyer: Remarks and Fast implementation," Their algorithm mimics characteristics of the real market such as self-similarity on different time scales (fractals), autocorrelation, randomness, and reversion to the Mean. This algorithm is available in the Wavelet Toolbox of Matlab-that greatest of software program for design and experimentation with math concepts.

Notes: *Brownian Motion is the random movement of particles suspended in a liquid or gas or the mathematical model used to describe such random movements. Here, it is used to generate the random component of our stock market series. The deterministic component was injected via a Hurst Exponent which is a measure of a time serie's dependence on its 'past'. Put another way, it is an indication of a time series 'memory' . The Hurst exponent (H)causes a time series to either regress to its Mean (average) or carry on its 'trending', such that clusters of volatility appear. H lies between 0 and 1, the greater H is, the more the dependence and determinism. H>0.5 exhibits long- range dependence and H<0.5 h="0.47">

#Wavelets: Wavelets are a revolutionary technique for compression, de-noising, break-down and pattern recognition of data. While already a few decades old, it is only recently that new kinds of Wavelets have made Wavelets more practical for implementation. Wavelets are used in e.g. the FBI's finger-print database, the compression of images without loss of quality, target recognition by the Military, electronic musical instruments tone synthesis, prediction of volatility changes in financial derivatives, earlier detection and prediction of cardiac failure, speech recognition, text recognition etc. Because of their properties, Wavelets are increasingly replacing Fourier transforms in Digital Signal Processing.

Based on the fractals of Chaos Theory, Abry, P and Sellan, F treated the Brownian motion as a fractional integral of white noise (randomness) and re-constructed it from a new biorthogonal wavelet based on coefficients of H. Whole families of wavelets have been been invented since the pioneering days of French researchers Ingrid Daubechies, Jean Morlet , Yves Meyer and Alexander Grosman.

And lastly, Image 1 right at the top is a very beautiful representation of the SP500 from Jan 2006 to July 2008 as a 1-Dimensional Continuous Wavelet Transform, looking like a rainbow beneath our quotes from the Bible. You can see little patterns and areas of fractal self-similarity in a visualization of the deterministic component of the market.

No comments:

Post a Comment