oneminusp.com Computational Finance, Markets, Programming & co

26Jan/100

Local order and predictability of financial time series

In this series of posts I will discuss an implementation and tests of the paper Local order, entropy and predictability of financial time series by L. Molgedey and W. Ebeling. (pdf)

The paper presents an excellent application of information theory to time series analysis. The idea is simple: is it possible to find sub-trajectories in financial time series (here the daily returns of some indices or stock) where a "local order" exists with higher than average predictability.

I won't explain the paper in full, so please have a look at the pdf above for notation and details. However I will describe the most important concepts below. We consider one-dimensional, discretely partitioned time series. The authors use Shannon entropy H as basic tool to measure uncertainty or predictability of the probability distribution described by the time series. For a certain trajectory of length n the uncertainty of predicting the next state is the difference in Shannon entropies for trajectories of length n+1 and n:

h_n = H_{n+1} - H_n

Let L be the total length of the time series, let \lambda be the length of the alphabet and A_1 \dots A_n is a specific subtrajectory of length n \le L.

Further, p^{(n)}(A_1 \dots A_n) is the probability to find a subtrajectory with the letters A_1 \dots A_n in the complete time series. Then the entropy is simply

H_n = -\sum{p^{(n)}(A_1 \dots A_n) \log_{\lambda} p^{(n)}(A_1 \dots A_n) }

Notice here that we take the logarithm of base \lambda, so the quantities are not measured in the more conventional bits. As described above from the conditional entropy h_n we define the average predictability as

r_n = 1 - h_n

Clearly, since we consider log(\lambda) units, the maximum uncertainty is h_n = 1. Also we can deduce that h_{n+1} \le h_n which is intuitively understandable as: the more I know the less uncertainty there can be, unless of course every observation was completely independent, where the equality would apply.

Next, the paper describes the "local uncertainty" measure as the uncertainty of the next symbol given the observation of specific symbols A_1 \dots A_n. The authors write it as

h_n^{(1)}(A_1 \dots A_n) = - \sum{p(A_{n+1} \vert A_1 \dots A_n) \log p(A_{n+1} \vert A_1 \dots A_n)}

Notice that this almost coincides with the conditional entropy H(A_{n+1} \vert A_1 \dots A_n) except that it leaves out the weighting factor of p(A_1 \dots A_n), thus it's not an averaging measure but a local one. The function h_n^{(1)} will be the main measure we apply to our time series.

Partitioning

As a next step we need to partition the real valued data of the time series into discrete symbols. First we take the daily logarithmic prices changes of some stock S_t:

x_t = ln(S_t) - ln(S_{t-1})

The returns x_t now need to be partitioned into symbols A_t of an alphabet with length \lambda. The optimal choice of partitioning is a whole other question, but for now we just assume that it doesn't matter. The paper uses for \lambda = 3 and partitions Dow Jones daily returns with the following thresholds:

x_t < -0.0025 \rightarrow A_t = 0, x_t > 0.0034 \rightarrow A_t = 2, \text{otherwise } A_t = 1

This is obviously different for every stock we look at and needs to be chosen depending on its basic statistics (skew, mean).

A randomly chosen snippet of a trajectory A_1 \dots A_n then might look like the string 0112012220201.

This is all we need to know for our implementation, which will be described in the next post of this series.

Comments (0) Trackbacks (1)

Leave a comment