L Modeling and Simulating Social Systems with MATLAB

Similar documents
6.254 : Game Theory with Engineering Applications Lecture 1: Introduction

6.207/14.15: Networks Lecture 15: Repeated Games and Cooperation

ECO 199 B GAMES OF STRATEGY Spring Term 2004 PROBLEM SET 4 B DRAFT ANSWER KEY

10 Evolutionarily Stable Strategies

The Basics of Game Theory

6.254 : Game Theory with Engineering Applications Lecture 2: Strategic Form Games

Overview. Swarms in nature. Fish, birds, ants, termites, Introduction to swarm intelligence principles Particle Swarm Optimization (PSO)

Particles, Flocks, Herds, Schools

Computational Learning Theory Spring Semester, 2003/4. Lecture 1: March 2

Game Theory and Algorithms Lecture 10: Extensive Games: Critiques and Extensions

Flocking and Steering Behaviors : Computer Graphics April 08, 2010

Chapter 7. Sealed-bid Auctions

0.0.2 Pareto Efficiency (Sec. 4, Ch. 1 of text)

Price competition with homogenous products: The Bertrand duopoly model [Simultaneous move price setting duopoly]

Introduction. Bargaining - whether over arms control, the terms of a peace settlement, exchange rate

Game Theory & Oligopoly Market. Decision making environments may be classified into four types:-

Competition and Regulation. Lecture 2: Background on imperfect competition

Behavioral Animation Simulation of Flocking Birds

Extraction of Satellite Image using Particle Swarm Optimization

When Machine Learning Meets AI and Game Theory

Integrating Cue Reading and Decision-Making into Skill Development

Théorie de la décision et théorie des jeux Stefano Moretti

Minimax Strategies. Minimax Strategies. Zero Sum Games. Why Zero Sum Games? An Example. An Example

How to Solve Strategic Games? Dominant Strategies

Topology Control and Mobility Strategy for UAV Ad-hoc Networks: A Survey

Bayesian Nash Equilibrium

AN INTRODUCTION TO GAME THEORY

Game Theory 1. Introduction

Lab 11. Simulations. The Concept

1 Nonzero sum games and Nash equilibria

Quotes from Object-Oriented Software Construction

14.74 Lecture 12 Inside the household: Is the household an efficient unit?

Simple Channel-Change Games for Spectrum- Agile Wireless Networks

Lecture 28 Economics 181 International Trade

Summary of Doctoral Dissertation: Voluntary Participation Games in Public Good Mechanisms: Coalitional Deviations and Efficiency

Web Appendix for Reference-Dependent Consumption Plans by Botond Kőszegi and Matthew Rabin

ECON 459 Game Theory. Lecture Notes Auctions. Luca Anderlini Spring 2015

LESSON 7: LEARNING MODELS

Week 7 - Game Theory and Industrial Organisation

Dynamics and Equilibria

Using Software Agents to Simulate How Investors Greed and Fear Emotions Explain the Behavior of a Financial Market

Operations and Supply Chain Management Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology Madras

21. Unverifiable Investment, Hold Up, Options and Ownership

Chapter 7. Evolutionary Game Theory

Oligopoly and Strategic Pricing

Towards a compliance audit of SLAs for data replication in Cloud storage

ECON101 STUDY GUIDE 7 CHAPTER 14

Chapter 7 Monopoly, Oligopoly and Strategy

MobLab Game Catalog For Business Schools Fall, 2015

ASTRATEGIC GAME is a model of interacting decision-makers. In recognition. Equilibrium: Theory

What Is Mathematical Modeling?

ECON Game Theory Exam 1 - Answer Key. 4) All exams must be turned in by 1:45 pm. No extensions will be granted.

Psychology and Economics (Lecture 17)

Perfect Bayesian Equilibrium

Chapter 7: Market Structures Section 1

Introducing Social Psychology

Liz Myers. From Front Porch to Back Seat: Courtship in Twentieth-Century America. Secondary Resource Paper. HIST 215A: American History

Internal Evolution for Agent Cognition Agent-Based Modelling of an Artificial Stock Market

Cournot s model of oligopoly

Oligopoly. Oligopoly is a market structure in which the number of sellers is small.

Online Appendix to Stochastic Imitative Game Dynamics with Committed Agents

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Games of Incomplete Information

CHAPTER 12 MARKETS WITH MARKET POWER Microeconomics in Context (Goodwin, et al.), 2 nd Edition

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Nash Equilibria and. Related Observations in One-Stage Poker

Creating a NL Texas Hold em Bot

Chapter 1 Introduction. 1.1 Introduction

Competition, Collusion and Regulation in Dynamic Spectrum Markets

9 Repeated Games. Tomorrow, and tomorrow, and tomorrow, Creeps in this petty pace from day to day To the last syllable of recorded time Shakespeare

1. Implementation of a testbed for testing Energy Efficiency by server consolidation using Vmware

Specialisation Psychology

Department of Economics The Ohio State University Economics 817: Game Theory

That s Not Fair! ASSESSMENT #HSMA20. Benchmark Grades: 9-12

Economics Instructor Miller Oligopoly Practice Problems

Evaluating the Lead Time Demand Distribution for (r, Q) Policies Under Intermittent Demand

Game Theory Syllabus

When other firms see these potential profits they will enter the industry, causing a downward shift in the demand for a given firm s product.

Capital Structure. Itay Goldstein. Wharton School, University of Pennsylvania

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 10

Internet Advertising and the Generalized Second-Price Auction: Selling Billions of Dollars Worth of Keywords

CHAOS, COMPLEXITY, AND FLOCKING BEHAVIOR: METAPHORS FOR LEARNING

6 Scalar, Stochastic, Discrete Dynamic Systems

Principled Negotiation and the Negotiator s Dilemma is the Getting to Yes -approach too soft?

6. Budget Deficits and Fiscal Policy

Christmas Gift Exchange Games

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

ECON 202: Principles of Microeconomics. Chapter 13 Oligopoly

Laboratory work in AI: First steps in Poker Playing Agents and Opponent Modeling

Transcription:

851-0585-04L Modeling and Simulating Social Systems with MATLAB Lecture 5 Agent-based Modeling / Game Theory Karsten Donnay and Stefano Balietti Chair of Sociology, in particular of Modeling and Simulation ETH Zürich 2012-10-22

Schedule of the course Introduction to MATLAB Research Plan is due TODAY Working on projects (seminar thesis) 24.09. 01.10. 08.10. 15.10. 22.10. 29.10. 05.11. 12.11. 19.11. 26.11. 03.12. 10.12. 17.12. Introduction to social-science modeling and simulations Handing in seminar thesis and giving a presentation 2

Goals of Lecture 5: students will 1. Consolidate their knowledge of cellular automata, through brief repetition of the main concepts introduced in the previous session. 2. Understand the important concept of Agent-based Modeling (ABM) as a powerful tool to capture complex system dynamics. 3. Get a brief introduction to Game Theory as a mean to formalize complex interaction dynamics such as human cooperation and coordination. 4. Build the basic structure of a simple agent-based simulator 3

Repetition Cellular automata (CA) are abstract representations of interaction dynamics in discrete space and time Reduce complexity of interaction to simple microscopic interaction rules; canonical way to formalize interaction range are Neighborhoods (Moore, van Neuman) Approaches using cellular automata have a few natural limitations: only discrete time space and time; results depend on updating scheme (simultaneous vs. sequential); system dynamics can not always easily be reduced to microscopic interaction rules Can be abstract test bed for complex systems: same results from CA and dynamical systems approach (Ex. 2) 4

Motivation for microscopic modeling A number of real world processes may be reduced to simple local interaction rules (e.g. Swarm Intelligence) Key for correctly capturing complex system dynamics with local individual interactions is that dynamic components of system are atomizable in the context under consideration (e.g. pedestrians behave like particles) Represents reductionist (or mechanistic) point of view in contrast to a systemic (or holistic) approach; in line with the tradition that has fueled the success of natural science research in the past 200 years! Game Theory provides great framework to formalize and reduce complex (strategic) interactions 5

Swarm Intelligence (1989) Ant colonies, bird flocking, animal herding, bacterial growth, fish schooling 6

Swarm Intelligence Key Concepts: decentralized control interaction and learning self-organization 7

Boids (Reynolds,1986) A boid is a simulated individual particle or object moving about in a virtual space. 8

More information:http://www.red3d.com/cwr/boids/ Separation: steer to avoid crowding local flockmates Alignment: steer towards the average heading of local flockmates Cohesion: steer to move toward the average position of local flockmates 9

Game Theory Mathematical framework for strategic interactions of individuals Formalizes the notion of finding a best strategy (keyword: Nash equilibrium) when facing a well-defined decision situation; conceptualization through games Underlying assumption is that individuals optimize their payoffs (or more precisely: utility ) when faced with strategic decisions NOTE: huge difference between game theoretic results for one-shot games vs. repeated interactions! 10

Game Theory: assumptions Game: (definition in class, or in any of the references) Rationality: alignment between preferences, belief, and actions Players prefer is to maximize its payoff function Players belief can be summarized with the saying I am rational, you are rational. I know that you are rational, and you know that I know that you rational. Everybody knows that I know that you are rational, and you know Players act accordingly: best response. 11

Nash Equilibrium 12

Nash Equilibrium It is the strategy that players always play with no regrets: best response. No players has an incentive to deviate from a Nash equilibrium Can be not unique Some questions Is Nash an optimal strategy? What is the difference between a Paretoefficient equilibrium and a Nash Equilibrium? Why do players play Nash? Do they? 13

Game Theory - Human Cooperation Prisoner s dilemma 15,15 20,0 0,20 19,19 14

The Evolution of Cooperation (Axelrod,1984) Tit for tat being nice (cooperate first) pay back immediately easy to be recognized Shadow of the future (discount parameter) if the probability of meeting again is large enough, it is better to be nice 15

Game Theory - Coordination Games 1,1 0,0 0,0 1,1 Game Examples: Stag-hunt Assurance game Chicken game Hawk-dove game 16

Evolutionary Game Theory Classical Game Theory suffers from a number of conceptual weaknesses (hyper-rational players, selection problem of strategy, static theory) Evolutionary Game Theory introduces evolutionary dynamics for strategy selection, i.e. the evolutionary most stable strategy dominates the system dynamics Players are rational about their own decisions but do not need to know the strategies (and reasoning) of all other players! Very suited for agent-based modeling approaches as it allows for learning and adaption of agents! 17

Evolutionary Learning The main assumption underlying evolutionary thinking is that the entities which are more successful at a particular time will have the best chance of being present in the future. Selection Replication Mutation 18

Evolutionary Learning Selection is a discriminating force that favors some specific entities rather than others. Replication ensures that the entities (or their properties) are preserved, replicated or inherited from one generation to another Selection and replication work closely together, and in general tend to reduce diversity the generation of new diversity is the job of the mutation mechanism 19

How agents can learn Imitation : People copy the behavior of others, especially behavior that is popular or appears to yield high payoffs. Reinforcement : People tend to adopt actions that yielded a high payoff in the past, and to avoid actions that yielded a low payoff. Best reply : People adopt actions that optimize their expected payoff given what they expect others to do. Subjects choose best replies to the empirical frequency distribution of their opponents previous actions, i.e. Fictitious Play. Agents may also update their beliefs about others behavior. 20

From Factors to Actors (Macy,2002) Simple and predictable local interactions can generate familiar but enigmatic global patterns, such as the diffusion of information, emergence of norms, coordination of conventions, or participation in collective action 21

From Factors to Actors (Macy,2002) Simple and predictable local interactions can generate familiar but enigmatic global patterns, such as the diffusion of information, emergence of norms, coordination of conventions, or participation in collective action Agents are autonomous Agents are interdependent Agents follow simple rules Agents are adaptive and backward-looking 22

From Factors to Actors (Macy,2002) Simple and predictable local interactions can generate familiar but enigmatic global patterns, such as the diffusion of information, emergence of norms, coordination of conventions, or participation in collective action Agents are autonomous Agents are interdependent Agents follow simple rules reduction/ atomization problem! Agents are adaptive and backward-looking can be a very problematic assumption!! 23

Programming a simulator Agent-based simulations the models simulate the simultaneous operations of multiple agents, in an attempt to re-create and predict the actions of complex phenomena. agents can be pedestrians, animals, customers, internet users, etc 24

Programming a simulator Agent-based simulations State update According to set of behavioral rules Time line Time t Characterized by a state (or states) (location, dead/alive, color, level of excitation) T1 dt Time t + dt New state T2 25

Programming a simulator Agent-based simulations State update According to set of behavioral rules, including neighborhood Time t Characterized by a state (location, dead/alive, level of excitation) Time t + dt New state Time line T1 T2 26

Programming a simulator Programming an agent-based simulator often goes in five steps Initialization - Initial state; parameters; environment Time loop - Processing each time steps Agents loop - Processing each agents Update - Updating agent i at time t Save data - For further analysis Initialization Time loop 27 end Agents loop end Save data Update state

Programming a simulator Efficient Structure define and initialize all variables in a script file that serves as the main of your program execute the actual simulation as function with the pre-defined variables as inputs automated analysis, visualization etc. of the simulation output may then be implemented in the main file using the outputs of the function that runs the actual program 28

Programming a simulator Step 1: Defining the initial state & parameters % Initial state t 0 =0; %begining of the time line dt=1 ; %time step T=100; %number of time steps %Initial state of the agents State1 = [0 0 0 0]; State2 = [1 1 1 1]; etc 29

Programming a simulator Step 1: Defining the initial state & parameters % Initial state t 0 =0; %begining of the time line dt=1 ; %time step T=100; %number of time steps %Initial state of the agents State1 = zeros(1,50); State2 = rand(1,50); 30

Programming a simulator Step 2: Covering each time step % time loop For t=t 0 :dt:t end What happen at each time step? - Update environment - Update agents 31

Programming a simulator Step 3: Covering each agent % agent loop For i=1:length(states) What happen for each agent? end 32

Programming a simulator Step 4: Updating agent i at time t % update % Each agent has 60% chance to switch to state 1 randomvalue=rand(); if (randomvalue<0.6) State(i)=1; else State(i)=0; end Use sub-functions for better organization!! 33

Programming a simulator Step 4: Updating agent i at time t % update % Each agent has proba chance to switch to state 1 randomvalue=rand(); if (randomvalue<proba) State(i)=1; else State(i)=0; end Define parameters in the first part!! 34

Programming a simulator Step 4: Updating agent i at time t % Initial state t 0 =0; %begining of the time line dt=1 ; %time step T=100; %number of time steps proba=0.6; %probability to switch state Define parameters in the first part!! 35

Programming a simulator Step 5: Final processing % Outputs and final processing propalive = sum(states)/length(states); And return propalive as the output of the simulation. 36

Programming a simulator Running simulation >> p=simulation() p = 0.54 >> p=simulation() p = 0.72

Programming a simulator Alternatively : a framework for the simulator % Running N simulations N=1000 %number of simulation for n=1:n p(n)=simulation(); end Use a framework to run N successive simulation and store the result each time. 38

Programming a simulator Alternatively : a framework for the simulator >> hist(p) 39

Exercise 1 There is some additional material on the iterated prisoner s dilemma available on the course website If you are not familiar with the game, the readyto-use implementation of the game will help you get a better understanding of its dynamics 40

Exercise 2 Start thinking about how to adapt the general simulation engine shown today for your project Problems: Workspace organization (files, functions, data) Parameters initialization Number of agents Organization of loops Which data to save, how frequently, in which format What kind of interactions are relevant 41

References Fudenberg & Tirole, Game Theory, MIT Press (2000) Meyerson, Game Theory, Harvard University Press (1997) Herbert Gintis, Game Theory Evolving, Princeton Univ. Press, 2 nd Edition (2009) Uhrmacher, Weyns (Editors), Multi-Agent Systems Simulation and Applications, CRC Press (2009) A step by step guide to compute the Nash equilibrium: http://uwacadweb.uwyo.edu/shogren/jaysho/nashnotes.pdf https://github.com/sandermatt/ethaxelrodnoise 42