Matteo Bondesan Marco Odifreddi

Simulation models for economics

Project work on

"Employment, growth and migrations."

 

The applet requires Java 5 or higher. Java must be enabled in your browser settings. Mac users must have Mac OS X 10.4 or higher. Windows and Linux users may obtain the latest Java from Oracle's Java site.


Here you can find an introduction to the Employment, growth and migrations application.


powered by NetLogo

view/download model file: employment_growth_migrations.nlogo

WHAT IS IT?

The model wants to shows how individuals’ migrations work; by endogenyzing the agent’s wage, the model is able to show you how people consider the GDP’growth rate and the unemployment rate in order to form expectations about their future level of labour income, hence they decide to move in those Countries whose garantize them a better level of life.
The different possible results (visible in the “Wage vs. Unemloyment” and the “GDP’Growth” graphs) are very interesting because the user can make a lot of modifications and the program replies in absolutely different and heterogeneous way.

HOW IT WORKS

A unique single behavioral rule: try to live better (by increasing its own standard of living); to do that, when the agents arrive close to the boundary of their Country, they decide if crossing the frontier or not, the decision criterion is built by taking into account the relative wage garantized in the other State; it is really relevant to notice the “main feature” of our model is the process of endogenyzation of the wage: the wage is function of the employment rate and the GDP-growth rate; therefore the wages are changing and the agents’ decisins too, by consequence.

HOW TO USE IT

First: press Setup
Second: press Move
Third: ragard very carefully to the results displayed in the two charts

The interface is very simple, it is formed by 11 sliders by mean the user can modifies the value of the “Country initail population”, the “initial level of Country’s unemployment” (i.e. the parameters of the model) and the percentage of “Rational people populating the world” (notice that the Irrational part of the population moves following a different rule with respect to the Rational’s decision criterion).
Furthermore in the interface there are two very important switches: the “endogenyzing process for the wage” and the “introduction of the GDP-Growth variability”; from these switches depends the 70% of the final result, indeed if the wage is exogenously fixed, the result is very trivial, instead if the wage is endogenous, the result is very complex and it varies a lot thanks to the GDP-Growth variability which introduces an important random element into the model.
The charts named “Wage vs. Unemployment” and “GDP-Growth” display the results; the graphs’ legendas are very useful in order to better understand how the model works, and the notes close to the charts are the direct consequence of what is running (the notes are self-explained).
Finally we have to mention the input button: “Seed”, it is important in order the make the simulations replicable (i.e. in order to implement the experiment in a scientific way); to this purpose it is important to notice the the results obtained by setting the same “Seed” can be different because of the “GDP-Growth variability” component which can assume a random float number between -1% and 1%.

THINGS TO NOTICE

The relevant “things to notice” have been already listed in the previous points, hence what we consider important in order to let the user well understand our model, is the analysis of the more complicate and strange parts of the code: in particular, the focus must be put on the “Move” part of the code which is composed by “move-agent”, “hire” and “reset-variable” : a well understanding of these 3 sub-parts is compulsory to internalize the focus of our model. See the second part of the relation accompaning the model in which the relevant part of the code are explained.

THINGS TO TRY

First of all the user can setup the sliders setted on the “real value” of the world economy in terms of Unemployment rate and GDP-Growth rate in the different Countries,
then he can modify them in order to try to influence the final result displayed in the charts.
Moreover the user has the possibility to endogenyze the wage and to add the GDP-Growth variability component.
Finally the use of the “Seed” is important to check the resuts.

EXTENDING THE MODEL

We propose to try to improve our model by inserting the Money and the Labor Market: bonds, stocks, payments, firms, public sector;
furthermore a great extension, in our opinion, is the “endogenyzation” of the GDP-growth rate as funcion of a lot of real and nominal variables to make the model more realistic, even if more complex.

CODE


patches-own [nation wage taxation_level employment_rate free_jobs employment_growth GDP_growth]
 
turtles-own [nationality employment rationality my_wage Dwage]



to setup
  
  clear-all
  
  if seed != 0 [random-seed seed]
  
  setup-patches
  
  setup-turtles
  
  reset-ticks
  
end


to setup-patches
  
  ask patches with[pxcor <= 0] with[pycor < 0]
  [ set pcolor red 
    set nation "china"
    set wage 2
    set taxation_level 0.2
    set employment_rate (1 - initial_level_of_chinese_unemployment)
    set GDP_growth 0.07] 
  
  
  ask patches with[pxcor <= 0]  with[ pycor >= 0]
  [ set pcolor blue 
    set nation "us"
    set wage 15
    set taxation_level 0.15
    set employment_rate (1 - initial_level_of_american_unemployment)
    set GDP_growth 0.04]
  
  ask patches with[pxcor > 0]  with[ pycor < 0]
  [ set pcolor orange 
    set nation "morocco"
    set wage 6
    set taxation_level 0.3
    set employment_rate (1 - initial_level_of_moroccan_unemployment)
    set GDP_growth 0.03]
  
  ask patches with[pxcor > 0]  with[ pycor >= 0]
  [ set pcolor cyan 
    set nation "italy"
    set wage 10
    set taxation_level 0.5
    set employment_rate (1 - initial_level_of_italian_unemployment)
    set GDP_growth 0.001]
  
  ask patches with[pxcor < 8]  with[pxcor > -8] with[pycor < 8] with[pycor > -8]
  [ set pcolor yellow 
    set nation "brazil"
    set wage 5
    set taxation_level 0.1
    set employment_rate (1 - initial_level_of_brazilian_unemployment)
    set GDP_growth 0.06]
  
  ask patches [let real_wage wage * (1 - taxation_level)
    let comparable (real_wage * employment_rate)]
  
end


to setup-turtles
  
  
  let remaining_chinese_birth chinese_initial_population
  while [remaining_chinese_birth != 0] [ask one-of patches with [nation ="china"] [sprout 1] set remaining_chinese_birth remaining_chinese_birth - 1]
  
  let remaining_american_birth american_initial_population
  while [remaining_american_birth != 0] [ask one-of patches with [nation ="us"] [sprout 1] set remaining_american_birth remaining_american_birth - 1]
  
  let remaining_moroccan_birth moroccan_initial_population
  while [remaining_moroccan_birth != 0] [ask one-of patches with [nation ="morocco"] [sprout 1] set remaining_moroccan_birth remaining_moroccan_birth - 1]
  
  let remaining_italian_birth italian_initial_population
  while [remaining_italian_birth != 0] [ask one-of patches with [nation ="italy"] [sprout 1] set remaining_italian_birth remaining_italian_birth - 1]
 
  let remaining_brazilian_birth brazilian_initial_population
  while [remaining_brazilian_birth != 0] [ask one-of patches with [nation ="brazil"] [sprout 1] set remaining_brazilian_birth remaining_brazilian_birth - 1]
  
  
  ask turtles [
    if nation = "china" [set nationality "chinese"]
    if nation = "us" [set nationality "american"]
    if nation = "morocco" [set nationality "moroccan"]
    if nation = "italy" [set nationality "italian" ]
    if nation = "brazil" [set nationality "brazilian"]  
  ]
  
  ask turtles [ set color white ]
  
  
  ask n-of int(chinese_initial_population * (1 - initial_level_of_chinese_unemployment)) turtles with [nationality = "chinese"] [set employment 1] 
  ask n-of int(american_initial_population * (1 - initial_level_of_american_unemployment)) turtles with [nationality = "american"] [set employment 1]
  ask n-of int(moroccan_initial_population * (1 - initial_level_of_moroccan_unemployment)) turtles with [nationality = "moroccan"] [set employment 1]
  ask n-of int(italian_initial_population * (1 -  initial_level_of_italian_unemployment)) turtles with [nationality = "italian"] [set employment 1]
  ask n-of int(brazilian_initial_population * (1 - initial_level_of_brazilian_unemployment)) turtles with [nationality = "brazilian"] [set employment 1]
  
 
  
  let world_initial_population (chinese_initial_population + american_initial_population + moroccan_initial_population + italian_initial_population + brazilian_initial_population)
  ask n-of int (rational_people * world_initial_population ) turtles [set rationality 1 set color black]
  
end


to move
    
  move-agent
  
  hire
  
  reset-variables
      
end


to move-agent
  
  let gainable 0
  let nation_here 0
  let comparable_for_employed 0
  let comparable_for_unemployed 0
  let exante_wage 0
  let expost_wage 0
  
  ask turtles 
  [set gainable [wage] of patch-here
   set my_wage gainable * employment
   set comparable_for_employed my_wage
   set comparable_for_unemployed [wage] of patch-here * [employment_rate] of patch-here
   set nation_here [nation] of patch-here
   set exante_wage [wage] of patch-here * employment
   
    ifelse rationality = 1        ; RATIONALS
    
    [ifelse employment = 1
      
      
      [ifelse any? patches in-cone 3 360 with [wage * employment_rate > comparable_for_employed]  
        
        [ask patches with [nation = nation_here] [set free_jobs free_jobs + 1] 
         move-to one-of patches in-cone 3 360 with [wage * employment_rate > comparable_for_employed] 
         ifelse [free_jobs] of patch-here = 0 
          [set employment 0] 
          [set nation_here [nation] of patch-here 
           ask patches with [nation = nation_here][set free_jobs free_jobs - 1 ]]   ]
        [set nation_here [nation] of patch-here
          move-to one-of patches in-cone 3 360 with [nation = nation_here]]   ]
      
      
      [ifelse any? patches in-cone 3 360 with [wage * employment_rate > comparable_for_unemployed]  
        
        [move-to one-of patches in-cone 3 360 with [wage * employment_rate > comparable_for_unemployed]
         set nation_here [nation] of patch-here
         if [free_jobs] of patch-here != 0 [
           set employment 1 
           ask patches with [nation = nation_here][set free_jobs free_jobs - 1 ]]   ]
        
        [set nation_here [nation] of patch-here
          move-to one-of patches in-cone 3 360 with [nation = nation_here]]  ]      ]    ; RATIONALS AND UNEMPLOYED
    
    
    
    [let way 1 if irrationality-type = "bounded-rationality" [set way 0.5] ifelse random-float 1 > way    ; NOT RATIONALS
      [ifelse employment = 1 
      
      [ifelse any? patches in-cone 2 30 with [wage > gainable]        
        
        [ask patches with [nation = nation_here] [set free_jobs free_jobs + 1]
          move-to one-of patches in-cone 2 30 with [wage > gainable] 
          ifelse [free_jobs] of patch-here = 0  
           [set employment 0]
           [set nation_here [nation] of patch-here
            ask patches with [nation = nation_here][set free_jobs free_jobs - 1 ]]   ] 
        
        [set nation_here [nation] of patch-here 
          move-to one-of patches in-cone 2 30 with [nation = nation_here] right random 360]   ]   ; NOT RATIONALS AND UNEMPLOYED
     
      
      [ifelse any? patches in-cone 2 30 with [wage > gainable]  
        
        [move-to one-of patches in-cone 2 30 with [wage > gainable]
          if [free_jobs] of patch-here != 0 
           [set employment 1
            set nation_here [nation] of patch-here
            ask patches with [nation = nation_here][set free_jobs free_jobs - 1]]   ]
        [set nation_here [nation] of patch-here
          move-to one-of patches in-cone 2 30 with [nation = nation_here] right random 360]]     ]
      
      [set way 0.1 if irrationality-type = "comlete-irrationality" [set way 1] ifelse random-float 1 > way 
        [ifelse any? turtles in-radius 3 with [xcor != [xcor] of myself or ycor != [ycor] of myself] 
          [let old_place [nation] of patch-here move-to one-of turtles in-radius 3 with [xcor != [xcor] of myself or ycor != [ycor] of myself] if old_place != [nation] of patch-here [if employment = 1 [set employment 0 ask patches with [nation = old_place] [set free_jobs free_jobs + 1]] ]]
          [move-to one-of neighbors]]
        [move-to one-of neighbors]
]]    ]
  
  ask turtles [set expost_wage [wage] of patch-here * employment set Dwage expost_wage - exante_wage]    ; IT IS REFERRED TO ALL INDIVIDUALS -> Individual_Wage_Improvement (in the Wage vs. Unemployment chart)
   
end


to hire
  
  ask patches  [set free_jobs int(free_jobs + (1000 * GDP_growth))]
  ask patches [if free_jobs < 0 [set free_jobs 0]]

  let max_existent_possible [free_jobs] of one-of patches with [nation = "china"]
  if count turtles with [nation = "china" and employment = 0] < [free_jobs] of one-of patches with [nation = "china"] [set max_existent_possible count turtles with [nation = "china" and employment = 0]]
  ask n-of max_existent_possible turtles with [nation = "china" and employment = 0] [set employment 1]  ; IT HOLDS ONLY FOR CHINESE WORKER because they need jobs more than other since they are the smaller wage
  ask patches with [nation = "china"] [set free_jobs free_jobs - max_existent_possible]
  
  set max_existent_possible [free_jobs] of one-of patches with [nation = "us"]
  if count turtles with [nation = "us" and employment = 0] < [free_jobs] of one-of patches with [nation = "us"] [set max_existent_possible count turtles with [nation = "us" and employment = 0]]
  ask patches with [nation = "us"] [set free_jobs free_jobs - max_existent_possible]
  
  set max_existent_possible [free_jobs] of one-of patches with [nation = "italy"]
  if count turtles with [nation = "italy" and employment = 0] < [free_jobs] of one-of patches with [nation = "italy"] [set max_existent_possible count turtles with [nation = "italy" and employment = 0]]
  ask patches with [nation = "italy"] [set free_jobs free_jobs - max_existent_possible]
  
  set max_existent_possible [free_jobs] of one-of patches with [nation = "morocco"]
  if count turtles with [nation = "morocco" and employment = 0] < [free_jobs] of one-of patches with [nation = "morocco"] [set max_existent_possible count turtles with [nation = "morocco" and employment = 0]]
  ask patches with [nation = "morocco"] [set free_jobs free_jobs - max_existent_possible]
  
  set max_existent_possible [free_jobs] of one-of patches with [nation = "brazil"]
  if count turtles with [nation = "brazil" and employment = 0] < [free_jobs] of one-of patches with [nation = "brazil"] [set max_existent_possible count turtles with [nation = "brazil" and employment = 0]]
  ask patches with [nation = "brazil"] [set free_jobs free_jobs - max_existent_possible]
  
end


to reset-variables
  
  let chinese_GDP_growth_variation (- 0.01 + random-float 0.02)
  let american_GDP_growth_variation (- 0.01 + random-float 0.02)
  let italian_GDP_growth_variation (- 0.01 + random-float 0.02)
  let moroccan_GDP_growth_variation (- 0.01 + random-float 0.02)
  let brazilian_GDP_growth_variation (- 0.01 + random-float 0.02) 
  
  ask patches with [nation = "china" ][if GDP_growth_variability [set GDP_growth GDP_growth + chinese_GDP_growth_variation]]
  ask patches with [nation = "us" ] [if GDP_growth_variability [set GDP_growth GDP_growth + american_GDP_growth_variation]]
  ask patches with [nation = "morocco" ] [if GDP_growth_variability [set GDP_growth GDP_growth + moroccan_GDP_growth_variation]]
  ask patches with [nation = "italy" ] [if GDP_growth_variability [set GDP_growth GDP_growth + italian_GDP_growth_variation]]
  ask patches with [nation = "brazil" ] [if GDP_growth_variability [set GDP_growth GDP_growth + brazilian_GDP_growth_variation]]
  
  ask patches 
  [ if endogenyzing_the_wage
   [ set wage wage * (1 + GDP_growth) / (2 - employment_growth)
    set employment_growth employment_rate * (1 + GDP_growth)
      ]
       ]
  
  ask patches [if wage < 0 [set wage 0]]
  
  tick
  
end