Exploring Financial InstabilityThrough Agent-based ModelingPart 1: Background and Early
Models
Blake LeBaronInternational Business School
Brandeis Universitywww.brandeis.edu/∼blebaron
Mini courseCIGI-INET: False Dichotomies
Course Road Map
Course Road Map
What AreAgent-basedModels?
Agent-basedFinancial Markets
Features of FinancialTime Series
Design Questions
A RepresentativeSimple Model
LeBaron CIGI/INET November 2012 – 2 / 38
Main goals and philosophy
LeBaron CIGI/INET November 2012 – 3 / 38
⊲ Basic modeling tools
Main goals and philosophy
LeBaron CIGI/INET November 2012 – 3 / 38
⊲ Basic modeling tools
⊲ Short guide to literature
Main goals and philosophy
LeBaron CIGI/INET November 2012 – 3 / 38
⊲ Basic modeling tools
⊲ Short guide to literature
⊲ Contributions to understanding financial marketdynamics
Main goals and philosophy
LeBaron CIGI/INET November 2012 – 3 / 38
⊲ Basic modeling tools
⊲ Short guide to literature
⊲ Contributions to understanding financial marketdynamics
⊲ Macro economic connections
Where are we going?
LeBaron CIGI/INET November 2012 – 4 / 38
⊲ Part 1:
•What are agent-based models?
•Simple models from finance
Where are we going?
LeBaron CIGI/INET November 2012 – 4 / 38
⊲ Part 1:
•What are agent-based models?
•Simple models from finance
⊲ Part 2:
•Adaptation and time series
•Heterogeneous gain learning
Where are we going?
LeBaron CIGI/INET November 2012 – 4 / 38
⊲ Part 1:
•What are agent-based models?
•Simple models from finance
⊲ Part 2:
•Adaptation and time series
•Heterogeneous gain learning
⊲ Part 3:
•Current directions in agent design and applications
•Empirical validation
• Instability and macro connections
Overview: Part 1
LeBaron CIGI/INET November 2012 – 5 / 38
Course Road Map
What Are Agent-based Models?
Agent-based Financial Markets
Features of Financial Time Series
Design Questions
A Representative Simple Model
What Are Agent-basedModels?
Course Road Map
What AreAgent-basedModels?
Agent-basedFinancial Markets
Features of FinancialTime Series
Design Questions
A RepresentativeSimple Model
LeBaron CIGI/INET November 2012 – 6 / 38
What are agent-based models?
LeBaron CIGI/INET November 2012 – 7 / 38
⊲ Individual, autonomous agents
What are agent-based models?
LeBaron CIGI/INET November 2012 – 7 / 38
⊲ Individual, autonomous agents
⊲ Distributions matter
What are agent-based models?
LeBaron CIGI/INET November 2012 – 7 / 38
⊲ Individual, autonomous agents
⊲ Distributions matter
⊲ Endogenous heterogeneity
What are agent-based models?
LeBaron CIGI/INET November 2012 – 7 / 38
⊲ Individual, autonomous agents
⊲ Distributions matter
⊲ Endogenous heterogeneity
⊲ Computational?
Where are they used?
LeBaron CIGI/INET November 2012 – 8 / 38
⊲ Economics
⊲ Finance
⊲ Marketing
Where are they used?
LeBaron CIGI/INET November 2012 – 8 / 38
⊲ Economics
⊲ Finance
⊲ Marketing
⊲ Sociology
⊲ Political Science
⊲ Biology
Where are they used?
LeBaron CIGI/INET November 2012 – 8 / 38
⊲ Economics
⊲ Finance
⊲ Marketing
⊲ Sociology
⊲ Political Science
⊲ Biology
⊲ Applications
•Public policy
•Business
•Military
Simple model philosophy
LeBaron CIGI/INET November 2012 – 9 / 38
⊲ Axelrod (1984)
⊲ Epstein and Axtell (1997)
⊲ Miller and Page (2007)
⊲ Schelling (1978)
Major resources in economics
LeBaron CIGI/INET November 2012 – 10 / 38
⊲ Handbook:Leigh Tesfatsion and Kenneth L. Judd, editors. Handbook ofComputational Economics: Agent-based computationaleconomics. North-Holland, Amsterdam, 2006
Major resources in economics
LeBaron CIGI/INET November 2012 – 10 / 38
⊲ Handbook:Leigh Tesfatsion and Kenneth L. Judd, editors. Handbook ofComputational Economics: Agent-based computationaleconomics. North-Holland, Amsterdam, 2006
⊲ ACE website:http://www.econ.iastate.edu/tesfatsi/ace.htm
Useful features for economic models
LeBaron CIGI/INET November 2012 – 11 / 38
⊲ Endogenous coordination
⊲ Small independent, individual shocks → large macroshocks
Why simple finance models?
LeBaron CIGI/INET November 2012 – 12 / 38
⊲ Understand financial price dynamics
⊲ Simpler agent behavior
⊲ Connections to macro
Why simple finance models?
LeBaron CIGI/INET November 2012 – 12 / 38
⊲ Understand financial price dynamics
⊲ Simpler agent behavior
⊲ Connections to macro
⊲ Modeling:Et(Pt+1) > Pt
Agent-based FinancialMarkets
Course Road Map
What AreAgent-basedModels?
Agent-basedFinancial Markets
Features of FinancialTime Series
Design Questions
A RepresentativeSimple Model
LeBaron CIGI/INET November 2012 – 13 / 38
Agent-based financial market goals
LeBaron CIGI/INET November 2012 – 14 / 38
1.Replicate interesting time series features
Agent-based financial market goals
LeBaron CIGI/INET November 2012 – 14 / 38
1.Replicate interesting time series features
2.Understand adaptive behavior and market ecology
Agent-based financial market goals
LeBaron CIGI/INET November 2012 – 14 / 38
1.Replicate interesting time series features
2.Understand adaptive behavior and market ecology
3.More realistic modeling platform
Useful finance surveys
LeBaron CIGI/INET November 2012 – 15 / 38
⊲ Chiarella et al. (2009)Carl Chiarella, Roberto Dieci, and Xue-Zhong He. Heterogeneity, market mechanisms, and asset price dynamics. In T. Hens and
K. R. Schenk-Hoppe, editors, Handbook of Financial Markets: Dynamics and Evolution, pages 277–344. Elsevier, USA, 2009
⊲ Hommes and Wagener (2009)Cars H. Hommes and Florian Wagener. Complex evolutionary systems in behavioral finance. In Thorsten Hens and Klaus Reiner
Schenk-Hoppe, editors, Handbook of Financial Markets: Dynamics and Evolution, pages 217–276. North-Holland, 2009
⊲ LeBaron (2006)B. LeBaron. Agent-based computational finance. In Leigh Tesfatsion and Kenneth L. Judd, editors, Handbook of Computational
Economics, pages 1187–1233. Elsevier, 2006
⊲ Lux (2009)Thomas Lux. Stochastic behavioral asset pricing models and the stylized facts. In Thorsten Hens and Klaus Reiner
Schenk-Hoppe, editors, Handbook of Financial Markets: Dynamics and Evolution, pages 161–215. North-Holland, 2009
Key features
LeBaron CIGI/INET November 2012 – 16 / 38
⊲ Interacting agents and/or strategies
⊲ Endogenous price time series
⊲ Endogenous heterogeneity
⊲ Self-contained learning:Learning → prices → learning → . . .
Time series and populations
LeBaron CIGI/INET November 2012 – 17 / 38
Time series features Strategy populations
Features of Financial TimeSeries
Course Road Map
What AreAgent-basedModels?
Agent-basedFinancial Markets
Features of FinancialTime Series
Design Questions
A RepresentativeSimple Model
LeBaron CIGI/INET November 2012 – 18 / 38
Financial empirical summary
LeBaron CIGI/INET November 2012 – 19 / 38
⊲ Short term
•Uncorrelated returns
•Volatility persistence
•Leptokurtic (fat tailed) return distributions
Financial empirical summary
LeBaron CIGI/INET November 2012 – 19 / 38
⊲ Short term
•Uncorrelated returns
•Volatility persistence
•Leptokurtic (fat tailed) return distributions
⊲ Long term
•Volatility persistence
•Return predictability
⋄Fundamental mean reversion
⋄Momentum (return persistence)
•Risk and return relationships
•Consumption and returns
Design Questions
Course Road Map
What AreAgent-basedModels?
Agent-basedFinancial Markets
Features of FinancialTime Series
Design Questions
A RepresentativeSimple Model
LeBaron CIGI/INET November 2012 – 20 / 38
Design questions
LeBaron CIGI/INET November 2012 – 21 / 38
⊲ Price determination
⊲ Learning and adaptation
⊲ Past data/learning gain
⊲ Information representations
⊲ Preferences
Very short history of agent-based finance
LeBaron CIGI/INET November 2012 – 22 / 38
⊲ Multi-agent (many/open)
•Computational learning algorithms
• Interesting and rich evolutionary dynamics
•Difficult to analyze
Very short history of agent-based finance
LeBaron CIGI/INET November 2012 – 22 / 38
⊲ Multi-agent (many/open)
•Computational learning algorithms
• Interesting and rich evolutionary dynamics
•Difficult to analyze
⊲ Simple (few agent models)
•Relatively easy to analyze
•Simpler dynamics
Very short history of agent-based finance
LeBaron CIGI/INET November 2012 – 22 / 38
⊲ Multi-agent (many/open)
•Computational learning algorithms
• Interesting and rich evolutionary dynamics
•Difficult to analyze
⊲ Simple (few agent models)
•Relatively easy to analyze
•Simpler dynamics
⊲ Hybrid models (in between)
Examples of many type
LeBaron CIGI/INET November 2012 – 23 / 38
⊲ Arthur et al. (1997)
⊲ Chen and Yeh (2002)
⊲ Tay and Linn (2001)
⊲ LeBaron (2001)
Many (open) type philosophy
LeBaron CIGI/INET November 2012 – 24 / 38
⊲ Idealized features
•New strategies/types/firms appear to take advantageof environment
•Realistic
⊲ Problems
•How well can you build open ended systems?
•Need to put in some assumptions/structure
Few type philosophy
LeBaron CIGI/INET November 2012 – 25 / 38
⊲ Small (sometimes 2) set of strategies
⊲ Often fixed parameters
⊲ Analytic results
⊲ Tractable dynamics
Two types
LeBaron CIGI/INET November 2012 – 26 / 38
⊲ Trend following, adaptive expectations
Ei,t(Pt+1) = Pt + g(Pt − Pt−1) g > 0 (1)
Two types
LeBaron CIGI/INET November 2012 – 26 / 38
⊲ Trend following, adaptive expectations
Ei,t(Pt+1) = Pt + g(Pt − Pt−1) g > 0 (1)
⊲ Fundamental/mean reverting
Ei,t(Pt+1) = Pf,t + ν(Pt − Pf,t) 0 ≤ ν ≤ 1 (2)Pf,t = Fundamental value (3)
Two types
LeBaron CIGI/INET November 2012 – 26 / 38
⊲ Trend following, adaptive expectations
Ei,t(Pt+1) = Pt + g(Pt − Pt−1) g > 0 (1)
⊲ Fundamental/mean reverting
Ei,t(Pt+1) = Pf,t + ν(Pt − Pf,t) 0 ≤ ν ≤ 1 (2)Pf,t = Fundamental value (3)
⊲ Building block for interesting dynamics
Two type models: Ancient history
LeBaron CIGI/INET November 2012 – 27 / 38
⊲ Zeeman (1974)Catastrophe theory
⊲ Frankel and Froot (1988)U.S. dollar behavior in the 80’s
⊲ Kirman (1991)Ants and contagion
Few type models: Core approaches
LeBaron CIGI/INET November 2012 – 28 / 38
⊲ Brock and Hommes (1998)
⊲ Chiarella and He (2001)
⊲ Day and Huang (1990)
⊲ De Grauwe and Grimaldi (2006)
⊲ Farmer and Joshi (2002)
⊲ Levy et al. (1994)
⊲ Lux and Marchesi (1999)
⊲ Westerhoff and Reitz (2003)
A Representative SimpleModel
Course Road Map
What AreAgent-basedModels?
Agent-basedFinancial Markets
Features of FinancialTime Series
Design Questions
A RepresentativeSimple Model
LeBaron CIGI/INET November 2012 – 29 / 38
Quick model structure
LeBaron CIGI/INET November 2012 – 30 / 38
Gaunersdorfer and Hommes (2007)
⊲ Trend following traders
⊲ Fundamental traders
⊲ Market clearing
⊲ Adaptive populations
====Andrea Gaunersdorfer and Cars Hommes. A nonlinear structural model for
volatility clustering. In A. Kirman and G. Teyssiere, editors, Micro Economic
Models for Long Memory in Economics, pages 265–288. Springer-Verlag, 2007
Quick model structure
LeBaron CIGI/INET November 2012 – 31 / 38
EF (Pt+1) = P ∗ + ν(Pt − P ∗) 0 ≤ ν ≤ 1
ET (Pt+1) = Pt + g(Pt − Pt−1) g > 0
Pt+1 =1
1 + r((1− nt)E
F (Pt+1) + ntET (Pt+1)) + y
Quick model structure
LeBaron CIGI/INET November 2012 – 31 / 38
EF (Pt+1) = P ∗ + ν(Pt − P ∗) 0 ≤ ν ≤ 1
ET (Pt+1) = Pt + g(Pt − Pt−1) g > 0
Pt+1 =1
1 + r((1− nt)E
F (Pt+1) + ntET (Pt+1)) + y
zTt =ET (Pt+1) + y − (1 + r)Pt
γσ2
zFt =EF (Pt+1) + y − (1 + r)Pt
γσ2
Quick model structure
LeBaron CIGI/INET November 2012 – 32 / 38
Rt = Pt + yt − (1 + r)Pt−1 yt = y + δt
uTt = RtzRt−1 + ηuTt−1
uFt = RtzFt−1 + ηuFt−1
Quick model structure
LeBaron CIGI/INET November 2012 – 32 / 38
Rt = Pt + yt − (1 + r)Pt−1 yt = y + δt
uTt = RtzRt−1 + ηuTt−1
uFt = RtzFt−1 + ηuFt−1
nt =eβu
T
t
eβuTt + eβu
Ft
nt = nte−(Pt−P ∗)2/α
Prices and returns in GH (no noise)
LeBaron CIGI/INET November 2012 – 33 / 38
0 200 400 600 800 1000 1200 1400 1600 1800 2000900
950
1000
1050
1100P
rice
0 200 400 600 800 1000 1200 1400 1600 1800 20000
0.2
0.4
0.6
0.8
1
Tre
nd fo
llow
ers(
frac
tion)
Adding noise to pricing
LeBaron CIGI/INET November 2012 – 34 / 38
EF (Pt+1) = P ∗ + ν(Pt − P ∗) 0 ≤ ν ≤ 1
ET (Pt+1) = Pt + g(Pt − Pt−1) g > 0
Pt+1 =1
1 + r((1− nt)E
F (Pt+1) + ntET (Pt+1)) + y + ǫt+1
Prices and returns in GH (noise)
LeBaron CIGI/INET November 2012 – 35 / 38
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000
500
1000
1500
2000P
rice
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000−0.1
−0.05
0
0.05
0.1
Ret
urn
Prices and trend fractions (nt) in GH (noise)
LeBaron CIGI/INET November 2012 – 36 / 38
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000
500
1000
1500P
rice
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000
0.2
0.4
0.6
0.8
1
Tre
nd fo
llow
ers(
frac
tion)
Few type summary
LeBaron CIGI/INET November 2012 – 37 / 38
⊲ Can get basic price dynamics
⊲ Two strategies as core dynamic
⊲ Other models similar
⊲ Requires noise for realistic prices
⊲ Generates large, erratic swings in strategy fractions
Overview: Part 1
LeBaron CIGI/INET November 2012 – 38 / 38
Course Road Map
What Are Agent-based Models?
Agent-based Financial Markets
Features of Financial Time Series
Design Questions
A Representative Simple Model