EVEXEX (Evolutionary Explanation of the Experiments) - program overview

Author: Mikhail Anufriev
Contact: <[email protected]>
Date: Fri May 25, 2007
Revision: 0.1
Copyright: GPL

Contents

1   Installation

The installation should be straightforward. Unpack the package:

tar xvzf evexex-{version}.tar.gz

move inside the source directory:

cd evexex-{version}

run the configure script:

./configure

then build the files:

make

become root:

su

and install them:

#make install

for more detailed instructions see the file "INSTALL".

2   Getting Started

The program evexex is written to simulate the model of evolutionary learning developed by M. Anufriev and C. Hommes. The model itself is aimed to explain the results of a recent learning to forecast experiment (see References below). This program reads data from standard input in an ASCII format and prints the result in ASCII format both to standard output.

Evexex is written in C and requires some external libraries. (see Required Libraries). It has been tested and used on the Gentoo Linux distribution but should run, in principle, on any Unix platform. No other OSes have been tested.

Please notice that the program has been written for personal use, and is distributed under the GPL license (see the file COPYING) in the hope it could be of help to other people, but without any implied warranty.

2.1   Required Libraries

Evexex is written in C and requires two non-standard libraries, Matheval and Regexp. Download both libraries from http://sourceforge.net/.

2.2   Brief Description of Program

The program reads the config file with forecasting rules and simulate the dynamics of the model with these forecasting rules. All parameters are provided in the command line. The initial prices are provided in the command line as well, while the initial shares assigned to different forecasting rules are read from the file.

The basic usage of the program is:

evexex [options] < [config file]

2.3   Config File

Each line of the file is the description of one forecasting rule. The lines beginning with a # symbol are considered comments and ignored.

The definition of each rule is a comma separated list of parameters whose value is set with an assignment of the form:

key=value

The possible parameters are

r
the definition of the rule. This can be defined as an arbitrary function with variables of the form pp#, ep#, ap#, fp, where pp = past price, ep = expected price, ap = average price, and fp = fundamental price. # stands for a single digit defining the lag of the variable.
n
the initial share assigned to the rule

For example the following line:

r=0.25*pp1+0.75*ep0,n=.3

defines an adaptive expectation prediction rule, according to which the next period price is equal to the convex combination of the price of the last period (i.e. the last available price) and the expected price for this period (i.e. the last available expectation). The initial share which will be assigned to the rule is .3.

2.4   Options

The following options are in use. The default values are shown in []. Notice that the outcome is controlled by the option -O:

-t simulation length [50]
-T transient length [0]
-s skip this number of steps in output [1]
-r riskless return [.05]
-S seed of the random number generator [0]
-Y

dividend structure. Define parameters values using pairs 'name=values'. Names are 'type', 'mean','stdev'. [type=0,mean=3,stdev=0]

List of types is:

0: normally distributed dividend

1: real noise from the experiment

-P initial price history given as p0,p1,p2,p3,etc [50]
-b parameter 'beta', intensity of choice [1]
-e parameter 'eta', memory in the performance measure [0]
-d parameter 'delta', fraction of conservative agents [0]
-O

set the output [tp].

List of options is:

t: step

p: price

y: dividend

n: share of robots

a: average prediction

P: prediction of the rules

N: share of the rules

U: performance of the rules

F: price forecasts

E: forecasting errors

-f existence of robot traders [0]
-v verbose output
-h this help

2.5   Examples

Here the command to produce the dynamics similar to the one observed in the group 2 of the experiment:

evexex -P 48,52 -b 0.3 -e 0.7 -d 0.9 -f -Y type=1 < fit_gr1.cfg

The meaning of this command is the following. Starting with sequence of two initial prices, 48 at time t=0 and 52 at time t=1 (-P 48,52), simulate the price series data with the same noise term as in the experiment (-Y type=1) and in the presence of the robot traders (-f). Three important parameters of the model are given as 0.3 for "intensity of choice" (-b 0.3), 0.7 for "memory in the performance measure" (-e 0.7), and 0.9 for the "proportion of conservative traders" (-d 0.9). Finally, the forecasting rules and initial shares are given in the file fit_gr1.cfg:

#adaptive
r=0.65*pp1+0.35*ep0,n=1

#weak trend chasing rule
r=pp1+0.4*(pp1-pp2),n=1

#strong trend chasing rule
r=pp1+1.2*(pp1-pp2),n=1

#adaptive trend heuristic with learning rule
r=0.5*ap1+1.5*pp1-pp2,n=1

Thus, 4 rules are used: adaptive (with the weight 0.65 assigned to the past price and weight 0.35 assigned to the past forecast), weak trend-following rule (when the agent extrapolates the 0.4 of the past price change starting from the level of past price), strong trend-following rule (when the agent extrapolates the 1.2 of the past price change starting from the level of past price), and adaptive trend heuristic with learning (when the agent starts with long-run average and extrapolates the past price change from there).

The initial shares assigned to the rules will be normalized. In this example all the rules have the same initial share.

2.6   How to Produce Plots

Using the data in standard output one can produce plots of the generated time series. We provide lines to generate plots with GNUPLOT, a portable command-line driven interactive data and function plotting utility for UNIX, IBM OS/2, MS Windows, DOS, Macintosh, VMS, Atari and many other platforms.

3   References

4   Package files list

AUTHORS            contact information
INSTALL            installation information
README             this file
evexex.c           source code of program evexex
plot.gp            gnuplot script for example of plots
tools.c            C utility functions
tools.h            C utility functions header file
fit_gr[1,2,7].cfg  files with examples for fitting of the experimental data