41
The RePast Framework and Social Simulations Presented by Tim Furlong

The RePast Framework and Social Simulations Presented by Tim Furlong

Embed Size (px)

Citation preview

Page 1: The RePast Framework and Social Simulations Presented by Tim Furlong

The RePast Framework and Social Simulations

Presented by Tim Furlong

Page 2: The RePast Framework and Social Simulations Presented by Tim Furlong

Overview

RePastSocial SimulationsSimulations implemented with RePast

Santa Fe Artificial Stock MarketEndogenizing Geopolitical Boundaries

Page 3: The RePast Framework and Social Simulations Presented by Tim Furlong

RePast

REcursive Porous Agent Simulation ToolkitJava class libraryUniversity of Chicago

Social Science Research Computing

Page 4: The RePast Framework and Social Simulations Presented by Tim Furlong

RePast: Framework

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

Utility classesSpatial representationsStatistical RNGs

Page 5: The RePast Framework and Social Simulations Presented by Tim Furlong

Generic approachDiscrete event simulator

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

Page 6: The RePast Framework and Social Simulations Presented by Tim Furlong
Page 7: The RePast Framework and Social Simulations Presented by Tim Furlong

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.

Page 8: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 9: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 10: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Norman Ehrentreich

Page 11: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 12: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 13: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 14: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 15: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 16: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Forecast for rule j: (aj,bj)

jittjittit bdpadpE ,,11,

Page 17: The RePast Framework and Social Simulations Presented by Tim Furlong

Forecast Accuracy

Fitness Value

2,11,12

,,112

,, 1 jittjittjitjit bdpadpvv

yspecificitbitCostvCf jtjt 2,,

Page 18: The RePast Framework and Social Simulations Presented by Tim Furlong

SFI-ASM: Rule Evolution

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

Mutation (p=0.7)Crossover

Page 19: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 20: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 21: The RePast Framework and Social Simulations Presented by Tim Furlong
Page 22: The RePast Framework and Social Simulations Presented by Tim Furlong

Faster learners exploit slower learners

Short-term trendsIn new model, only valid in beginning

Page 23: The RePast Framework and Social Simulations Presented by Tim Furlong

Endogenizing Geopolitical Boundaries with Agent-based Modeling

Lars-Erik Cederman

Page 24: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 25: The RePast Framework and Social Simulations Presented by Tim Furlong

EGB: Background

Essentialist perspectiveIgnore change of actorsFixed entities with attributes

Sociational perspectiveDynamic actors and relationshipsContext-sensitive

Page 26: The RePast Framework and Social Simulations Presented by Tim Furlong

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)

Page 27: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 28: The RePast Framework and Social Simulations Presented by Tim Furlong

EGB: EP turn structure

Five phases per turnResource allocationDecisionsInteractionResource updatingStructural change

Page 29: The RePast Framework and Social Simulations Presented by Tim Furlong

Resource allocationAllocate troops to borders based on strength of neighbors

DecisionsReciprocate aggressive actionAttempt unprovoked attacks

Page 30: The RePast Framework and Social Simulations Presented by Tim Furlong

InteractionResolve conflicts based on balance of power

Resource updatingStates gain resources from provinces

Structural changeStructure of defeated state altered by outcome of conflicts

Page 31: The RePast Framework and Social Simulations Presented by Tim Furlong
Page 32: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 33: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 34: The RePast Framework and Social Simulations Presented by Tim Furlong
Page 35: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 36: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 37: The RePast Framework and Social Simulations Presented by Tim Furlong
Page 38: The RePast Framework and Social Simulations Presented by Tim Furlong

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’

Page 39: The RePast Framework and Social Simulations Presented by Tim Furlong
Page 40: The RePast Framework and Social Simulations Presented by Tim Furlong

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

Page 41: The RePast Framework and Social Simulations Presented by Tim Furlong

Questions?