The RePast Framework and Social Simulations Presented by Tim Furlong

Preview:

Citation preview

The RePast Framework and Social Simulations

Presented by Tim Furlong

Overview

RePastSocial SimulationsSimulations implemented with RePast

Santa Fe Artificial Stock MarketEndogenizing Geopolitical Boundaries

RePast

REcursive Porous Agent Simulation ToolkitJava class libraryUniversity of Chicago

Social Science Research Computing

RePast: Framework

Base classes to be extendedEngine classAgent classEnvironment classGUI displays, charts, graphs

Utility classesSpatial representationsStatistical RNGs

Generic approachDiscrete event simulator

Easy implementationSugarScape(partial) : ~ 650 LOCGame of Life : ~ 750 LOC

RePast: Advantages

Facilitates implementationConvenient representation of heterogeneous agentsSupport for geometric world modelsGarbage collection

‘Powerful’ visualization techniquesLars-Erik Cederman, “Endogenizing Geopolitical Boundaries with Agent-based Modeling”, prepared

for Sackler Colloquium on “Adaptive Agents, Intelligence, and Emergent Human Organization: Capturing Complexity through Agent-based Modelling”, Oct. 2001.

RePast: Applications

School voucher programsConsumer choiceDecision making in closed regimesModeling the size of warsVoting dynamicsSelf-organizing computer networksMulti-cellular tumors

Repast Homepage – Projects and Publications : http://repast.sourceforge.net/projects.html

Social Simulations

Goal is to simulate observed behaviors with hypothesized modelSeveral ‘flavors’ of simulation

Statistical : global variablesAgent-based : allows heterogeneous agents with varied and dynamic behavior

The Santa Fe Artificial Stock Market Re-Examined: Suggested Corrections

Norman Ehrentreich

SFI-ASM: Introduction

Simplistic stock market simulationIsolates learning speed of traders as critical parameterBased on original SFI-ASMFixes faulty mutation operator

Results not quite as compelling

Interesting RePast model

SFI-ASM: Original Model

N traders1 unit risky stock, 20 000 units cash

Each trader seeks to buy or sell stock based on expectations of profitProfit

Fixed return of rf on cash assets

Stock pays stochastic dividend

SFI-ASM: Stock

Only one ‘stock’ in marketStock has price pt and dividend dt

Dividend of stock at time t +1

Mean-reverting factor of (1 – ρ), but generally stochastic

),0(~

)(2

11

N

dddd ttt

SFI-ASM: Traders

Risk aversion factor of λi

Wealth at time t of Wi,t: stock + cash

Optimal amount of stock based on expectations of profit

tittiftttiti xpWrdpxW ,,11,1, 1

2,

11,,

dpt

fttttiti

rpdpEx

SFI-ASM: Expectation rules

Market has descriptor Dt

Bitstring of market conditions

Each trader has own set of 100 rulesRule comprised of:

ConditionForecastForecast accuracyFitness value

Condition is pattern matching ruleString of {0,1,#}Bits are technical or fundamental

Forecast for rule j: (aj,bj)

jittjittit bdpadpE ,,11,

Forecast Accuracy

Fitness Value

2,11,12

,,112

,, 1 jittjittjitjit bdpadpvv

yspecificitbitCostvCf jtjt 2,,

SFI-ASM: Rule Evolution

Genetic algorithm invoked after every K rounds of trading to evolve rules

Mutation (p=0.7)Crossover

SFI-ASM: Correction

Original had faulty mutation operatorBiased results to higher number of non-# bits

Correct solution for rules is to converge to all-# bits

Dividend and price too random to classify

With new operator, rules always converge

SFI-ASM: Results

Rules converge to all-# bitsReach homogeneous rational expectation equilibrium eventually

With values for K < 100, complex trading emerges

Harder to persuade the model to do this with the new mutation operator

Faster learners exploit slower learners

Short-term trendsIn new model, only valid in beginning

Endogenizing Geopolitical Boundaries with Agent-based Modeling

Lars-Erik Cederman

EGB: Introduction

Agent-based modeling has potential to avoid reification of actors

Reification: treating an abstract concept as concrete

Long-term simulations require “sociational endogenization” of actors

Actors must be internally dynamic

EGB: Background

Essentialist perspectiveIgnore change of actorsFixed entities with attributes

Sociational perspectiveDynamic actors and relationshipsContext-sensitive

EGB: Endogenization

Presents series of models to illustrate progression from reified actors to endogenous ones

Modeling emergence of state borders

Emergent Polarization (EP)Democratic Peace (DP)Nationalist Systems Change (NSC)

EGB: Emergent Polarization

Models conquest and expansion of statesVillages or counties on a finite 2d gridStates emerge as villages conquer neighbors

State has capital based on original villageResources gathered from the territories depends on distance to capital

EGB: EP turn structure

Five phases per turnResource allocationDecisionsInteractionResource updatingStructural change

Resource allocationAllocate troops to borders based on strength of neighbors

DecisionsReciprocate aggressive actionAttempt unprovoked attacks

InteractionResolve conflicts based on balance of power

Resource updatingStates gain resources from provinces

Structural changeStructure of defeated state altered by outcome of conflicts

NotesStates can spread too thin, inviting attack from other neighbors and opening multiple fronts to conflictCan extend the model to allow alliances between states

EGB: Democratic Peace

Adds categorical relationships to previous modelObserved that democracies do not fight each otherAdd ‘democracy’ label to some statesDemocracies do not fight each other, and form a defensive coalition

NotesDifference in balance of power produces significant resultsExample of adding ‘categorical social’ processes• Threat evaluation is still relational

EGB: Nationalist Systems Change

Introduce concept of actors separate from states : nations

Nations and states sometimes coincide, but not always

Each village has ‘cultural’ identity : string of trait valuesNation is a pattern string of traits with wildcards

Nations founded and joined by agents

Capitals more likely to found nations due to resources

National identities have major impact on inter-state relations

‘irredentist’ invasions to conquer conationals not under ‘home rule’

EGB: Conclusions

Agent-based simulations are better at modeling complex phenomenae than conventional approachesTreating actors as themselves emergent and internally dynamic is necessary to good simulation over long time scales

Questions?