Skip to content
Dan edited this page May 23, 2013 · 17 revisions

The objective of this appendix is to describe the mechanics of information recovery from dynamic econometric models. All source code for our paper is open and written in Clojure, a new dialect of Lisp. This appendix will describe the estimation procedures through detailed documentation of the code.

Consider a time series of length T. Within the full time series there will be T - D + 1 sub-blocks of length D. The following illustration represents the D! ordinal patterns for sub-blocks when D = 3:

Note that the patterns do not reflect the values within the sub-blocks, but rather the ordinal relationships between the values in the sub-blocks. The permutation entropy method relies on the ordinal sequencing of sub-blocks, and the subsequent counts of these ordinal sub-sequences. The relative frequencies of sub-sequences reveals information about the underlying dynamics of the data series. Consider an N length series, independently and identically distributed standard normal. The following is a simple plot of a series with N = 100.

The functional programming framework is particularly well suited to the analysis of permutation entropy. The final procedure is built from smaller component functions. The first function returns a sequence of indices that indicate the rank of each value within the supplied sub-sequence sub-ts.

(defn- ordinal-idx
  "Returns a sequence of indices that rank the values of the supplied
  time series in ascending order.  If there are equal values, the
  lexicographic ordering kicks in and the order at which the values
  appear is used to order the indices."
  [sub-ts]
  (let [indexed-vector (map-indexed vector sub-ts)]
    (map first
         (sort-by second indexed-vector))))

For example,

Clone this wiki locally