### Predict a random time series

Now and then it is worth checking how the ANN performs in completely random time series. This technique is invaluable and often neglected. A couple times, it revealed that there were some bugs in the code. The basic idea is that the ANN can learn the random series, but the prediction power should be zero. **If the ANN can predict the completely random time series that means there is a serious bug in the code.**

A couple of months ago this technique showed me that my code had a bug in which the ANN could use training samples that was actually in the future. So, the ANN learned the future and it could predict even the random sequence.

This how I construct the ‘virtual’ (random) RUT index:

`randPercChange = random('Normal', 1, 0.01, length(indexCloses), 1); % 1percent stddev`

randSeries = ones(length(indexCloses), 1);

randSeries(1) = indexCloses(1);

for i=2:length(indexCloses)

randSeries(i) = randSeries(i - 1) * randPercChange(i - 1);

end

indexCloses = randSeries;

I show the statistics here:

Luckily,** the ANN couldn’t predict the random sequence.** This is a necessary, but not sufficient condition for proving that the ANN implementation is correct.

It is a good to see that the same ANN code had a directional accuracy for the random RUT at about 50%, it has a directional accuracy for the real RUT at about 53%. Trying to refute the random walk theory of stock markets, we conclude that in real life, t**he RUT daily returns cannot be random, because it can be predicted.**

Filed under: Uncategorized | Leave a Comment

## No Responses Yet to “Predict a random time series”