A Data Science Central Community
Many time series charts seem to exhibit a pattern: an up-trend, apparent periodicity, a stochastic process that seems not to be memory-less, and so on. Look at the following picture, representing stock price simulations. Do you think there is an up-trend? Actually, long term, there isn’t: it’s a realization of a pure random walk. At any time, the chance that it goes up or down by a given amount, is exactly 50%. Yet, on short term periods, it is perfectly normal to observe ups and downs. It does not make this time series predictable: you could try to design a predictive model trained on the first 1,000 observations, then test it on the remaining 1,000 observations. You would notice that your model is not better (for predicting up and down movements) than randomly throwing a dice.
Figure 7.4: This is a random walk, indeed!
Other tests that you can do to familiarize yourself with how randomness and lack of randomness look like, is to simulate auto-regressive time series. One of the most basic processes is X(t) = a * X(t-1) + b * X(t-2) + E + c, where t is time, c is a constant (-0.25 < c < +0.25) and E an error term (white noise) simulated as a uniform deviate on [-1, +1]. For instance, X(t) represents a stock price at time t. You can start with X(0) = X(1) = 0. If a + b = 1, then the process is stable, in equilibrium (why?) If c < 0, there is a downward trend. If c > 0, there is an upward trend. If c = 0, it does not go up or down (stationary process). If a = b = 0, the process is memory-free, there no stochastic pattern embedded into it, it just pure noise. Try producing some of these charts with various a, b, c and see if you visually notice the pattern, and can correctly interpret it. In the above figure, c = 0, b = 0, a =1. Of course, with some values of a, b and c, the patterns are visually obvious. But if you keep both c and a + b close to zero, it is visually a much more difficult exercise, and you might have to look at a long time frame for your brain to recognize the correct pattern. Try detecting the patterns with a predictive algorithm, and see when and if your brain can beat your predictive model!