Wolfram Science Group
Phoenix, AZ USA
Registered: Aug 2003
Times series from five color totalistic CAs
I got a question through email about making times series - as for economic or financial data for instance - from CAs, with more states allowed per cell than the 2 color example given in the NKS book. I thought some here might be interested in the attached notebook for exploring these. The question made reference to five traditional "market psychology" categories, so some of the response below is in those terms. The set up and the code obviously generalize to other specific values, intuitive mappings, etc.
It is straightforward to generalize the approach Stephen Wolfram takes in NKS, to Cellular Automaton rules with more colors, which one might intuitively map to your five traditional psychological categories for instance. If these are taken to be states of individual market actors, rather than collective states of overall sentiment, then we can apply the basic idea of the NKS book set-up to get a series. Each cell is in one of the five states. For simplicity, I assume the local rule is only range 1 (nearest neighbors), 1D, and totalistic (meaning having two neighbors in
"hope" is equivalent to having one in "greed" and another in "restoration", etc). One could relax any of these simplifying assumptions, and get even more possible rules.
The functional form of the built in Mathematica function "CellularAutomaton" is particularly easy to program and understand for this sort of thing. One just sets up a "Switch" function that specifies what the next state of the cell will be, given its local total on the previous step, from its own value
and that of its neighbors, combined. With 5 colors, there are 13 such possible totals - 0+0+0 giving 0 to 4+4+4 giving 12. As soon as you specify what state each of those 13 possible totals goes to, you have specified the rule. One can pick settings that seem to make intuitive sense.
Alternately, one can do the typical NKS thing and consider the whole space of possible rules of this type, and see how they typically behave. There are 1.2 billion rules of this form, corresponding to all numbers up to 13 digits long in base 5. The attached notebook shows some examples and gives the code for evolving these. You can see the whole array - the mix of
states across the population at any given time - and can create a totaling series from them (effectively "averaging", with different weights to the different states possible) to get an analog of a price series.
If on the other hand one thinks of the five states as global rather than actor-level things, then effectively one is trying to cram all the intricacy of a price series into 5 states. One can do that, but the model will end up needing to be probabilistic - because there simply isn't enough complexity in 5 deterministic states - plus "before" and "after" - to account for all the variation we see in empirical price series.
The way you'd do that instead, is to consider a Markov model with 5 states, each with some probability of transitioning to each of the other 5, and also with some associated change in price. Essentially, your 5 global states give you the first differences of the price series. A probabilistic state transition matrix among those 5 states specifies the basic form of the "rule". This is a somewhat less NKS way of looking at the matter, more like
a generalized random walk - but it still yields a simple program (a few lines of Mathematica code) that generates reasonably complex looking series.
This has been downloaded 1677 time(s).
Report this post to a moderator | IP: Logged