Benedetta Bianchi Cristina Platon

Simulation models for economics

Project work on

"Wage Pension Migration 2."

 

The applet requires Java 1.4.1 or higher. It will not run on Windows 95 or Mac OS 8 or 9. Mac users must have OS X 10.2.6 or higher and use a browser that supports Java 1.4. (Safari works, IE does not. Mac OS X comes with Safari. Open Safari and set it as your default web browser under Safari/Preferences/General.) On other operating systems, you may obtain the latest Java plugin from Sun's Java site.


powered by NetLogo

view/download model file: wage_pension_migration2.nlogo

WHAT IS IT?

This work aims at understanding and explaining the behaviour of workers who face the choice of the best country where they would like to live, according to their preferences about the trade off between wage now and pension tomorrow, their years left before retirement, the income they happen to have and the tax regimes of countries.


HOW IT WORKS

The model contains two countries and two different kinds of agent. Countries are distinguished by different income (in total and in distribution) and tax levels, reflecting the real world, where states have different sizes of the economy, more or less equally distributed earnings, and adopt different fiscal policy choices. Agents are citizens with distinct characteristics: some are forward looking, and give more importance to their future pension than to their actual wage, whereas some are unforeseeing and care only about their wage today. In the economic theory individuals make their retirement decisions and job choices on the basis of discounted present values of income flows expected for the options. The differences in the perception of time between individuals is captured by their personal discout rate: present oriented persons have higher discount rates than forward looking ones, hence lower present values of income flows in the future. In this work, as we wanted to focus our attention on the outcomes resulting from preference and income distributions, rather than the mathematic representation of those preferences, we have not included present values. Agents simply have inclination toward either wage today or pension tomorrow. Consequently, every person has a "favourite country", where they decide to move if it is not their State of origin. An interaction between agents is performed as follows: workers who want to move have an influencing effect on those who want to stay, and have the power of convincing them to leave. The converse is not true, as we thought it is more realistic if the choice of remaining is given by other factors than imitation, as affection to your birth country or patriottic issues. It is more likely in our view that adventurous people can persuade others while steady people cannot convince adventurous. Several variables are controlled by the observer, leading to various states of the world, and consequently to different rules for agent's acting, the most important of which are the tax level and the average (or distribution of) wage within each State.


HOW TO USE IT

Countries
The two countries are called country1 and country2 and each of them possesses the following features.

There are 3 distributions of income which the experimenter can choose from, namely random drawing, normal distribution and gamma distribution. The respective parameters can be changed from the sliders. The age of retirement is the same, 65, everywhere.

Rules
number-people: it fixes the number of agents on which the experiment is set up;
percentage-higher: it indicates the proportion by which a wage or a pension in a country has to exceed the wage or pension of the other country to induce agents to move out.

Agents
The agents have the following variables:
yearsOld: age;
preference: 0 if the person prefers high wage [white], 1 if she prefers high pension [black]
decision: 0 if the agent decides not to move [blue], 1 if she decides to move [red]
total: sum of the decisions of the neighbours
yearsb4retirement: 0 if the person is less than 65, 65 – yearsOld if she is more than 65
wage: drawn from the distribution that the observer has previously chosen


THINGS TO NOTICE

The two variables “preference” and “decision” differ for the fact that the first one is a quality of the agents, which does not change with ticks – years, while the second depends, other than on preferencies, also on other variables such as total and yearsb4retirement, so it can change from a tick to another. White color is assigned to people with high wage preference, black to high pension preference ones. This subdivision of colours, though, is visible only at the first tick, as after that agents make their decision and change color: red if they want to move, blue if they do not. YearsOld and preference are assigned in a random way, the first ranging from 0 to 99; the second from 0 to 1.


THINGS TO TRY


EXPERIMENT 1

Close averages, similar taxes


EXPERIMENT 1.1

WAGE DISTRIBUTION: random-numbers
number-people: any number
percentage-higher: 0.2
meanDist = 5000
stdDev = 50
tax1 = 0.3
tax2 = range [0.26 – 0.36]
outcome: differently from model 1, not all people are happy because they own different levels of salary and they pay different amounts of tax. Therefore, reactions depend both on turtles-own variables and on countries's characteristics. Performing the experiment several times with several tax rates in the range assigned to country2, we get that only few people decide to move. The populations of the 2 states are initially pretty close and after the 50th tick they start to separate, in the majority of cases in favor of country2 – green patches, regardless of whether we put tax2 closer to 0.26 or 0.36.


EXPERIMENT 1.2

WAGE DISTRIBUTION: normal-distribution
number-people: any number
percentage-higher: 0.2
meanDist = 5000
stdDev = 50 and 1000
tax1 = 0.3
tax2 = range [0.26 – 0.36]
outcome: with normal distributed wages and low variance people are again happy with their initial situation and nobody wants to move out because wages are highly concentrated around the mean – this makes this situation similar to the experiment in model 1. When we increase the variance, though, wages start being more dispersed around the medium and differences in behaviour arise: some agents decide to emigrate every tick, forever. This is due to the fact that those individuals have wages lower than the average so they keep on moving, hoping to be able to reach the average wage of the other country, after migration. We call these agents “hopeless”. Citizens are evenly distributed among countries because preferences are randomly assigned – hence either has a 50% probability; normal distribution is symmetric – so there are the same proportion of people with wage above the mean as those with below-the-mean wages; and the imitation takes place if more than 5O% or neighbours moves. As a result, in this experiment where average wages are the same and tax rates are close together, population is equally spread out among the 2 countries.


EXPERIMENT 1.3

WAGE DISTRIBUTION: gamma-distribution
number-people: any number
percentage-higher: 0.2
combinations of alpha and lambda, respectively:
[10, 2]; [100, 2]; [1, 10]
tax1 = 0.3
tax2 = range [0.26 – 0.36]
outcome:
[10, 2]: some people decide to move out and they do it every tick
[100, 2]: very few people decide to move out, every tick
[1, 10]: a relatively high number of people moves, every tick
Population in every case is nearly evenly distributed among countries – for the same reason as before. The reason why “hopeless” people are more in the third setting of the experiment is that with those different parameters the gamma distribution is more strongly positively skewed: the variance is higher, relatively to the mean, and the median is more on the left. Consequently, there is a greater number of poor people, the income of whom is below the average.


EXPERIMENT 2

Different averages, different taxes


EXPERIMENT 2.1

WAGE DISTRIBUTION: random-numbers [ 0 to 9999]
number-people: any number
percentage-higher: 0.2
tax1 = 0.60
tax2 = 0.25
outcome: roughly 1 nineth of the population moves every tick. As before, the difference with model 1 resides in the fact that the random distribution of income makes people with below-the-average wages be “hopeless”. The proportion of citizens of the 2 countries is the same.


EXPERIMENT 2.2

WAGE DISTRIBUTION: normal-distribution
number-people: any number
percentage-higher: 0.2
meanDist = 4500
stdDev = 600
tax1 = 0.60
tax2 = 0.25
outcome: for the first 2 ticks, there are people who want to move out. Sometimes there are red people also at the third tick, because the assignment of both the position and the preference of individuals is random, so the imitation procedure could make people take the suboptimal choice more or less times, according to the output of this randomness. Moreover, in every try the number of final citizens is higher in country 2. Almost all high wage people move in country2, because the tax is so much smaller there that it makes their present net wage ( wage – tax) very advantageous. We still have one or two wage people left in country1, because their wage is still high enough for them. These people leave at the second tick, because the average wage in country2 gets higher. At the same time, pension people - future looking - see the high tax in country1 and move there(those who have more than 15 years left from retirement). After the first tick, some other pension people follow by imitation.


EXPERIMENT 2.3

WAGE DISTRIBUTION: gamma distribution
number-people: any number
percentage-higher: 0.2
combinations of alpha and lambda, respectively:
[10, 2]; [100, 2]; [1, 10]
tax1 = 0.3
tax2 = range [0.26 – 0.36]
outcome:
- [10, 2]: some people decide to move out and they do it every tick
- [100, 2]: very few people decide to move out, every tick
- [1, 10]: a relatively high number of people moves, every tick
outcome: population in every case is nearly evenly distributed among countries – for the same reason as before. The reason why “hopeless” people are more in the third setting of the experiment is that with those different parameters the gamma distribution is more strongly positively skewed: the variance is higher, relatively to the mean, and the median is more on the left. Consequently, there is a greater number of poor people, the income of whom is below the average. These people are hopeless because every tick they move in the other country hoping to reach its average wage, with no success, so they kep doing it.


EXTENDING THE MODEL

This model could be extended using the the life-cycle model for retirement decision, in order to describe agents' preferences. That is, calculations of present values of income flows could be put in, and, giving different discount rates to each individual, it would be possible to differenciate their preferences. Rather than having only 2 categories - present oriented and forward looking people, it would be possible to have a more complex distribution of preferences.


NETLOGO FEATURES

The two main procedures are "setup" and "go".

In "setup", the first thing we do is clearing the space from the previous execution of the model. Then, we use two different procedures to set up turtles and patches, so the model is clearer for anyone interested.

In "setup-patches", we divide the view in two parts (or countries) by naming country1 the patches with the x coordinate greater than zero (the patches on the right of the screen) and country2 the other ones (the patches on the left of the screen).

In "setup-turtles", we create turtles (persons, for the purposes of this model) and set up their variables. We randomly choose an age for the people (with set yearsOld random 100). Then, we use an "ifelse" condition to find out the number of years of work each person has before retirement. We set the variable yearsb4retirement to 0 if the person is already older than an average retirement age of 65 and to 65 – yearsOld if the person is still at an employment age. We randomly set a preference for each person, either 0 or 1. At last, we place the people at a random location in the View box.

In "setup-turtles" we also use the information we get from the chooser. So, if the user picks random-numbers, the wage variable is set randomly, for each person, to a number between 0 and 9999. If the user did not pick this option, we check whether he chose normal-distribution, and if that is the case, the wage variable for the turtles will be normally distributed, with the mean meanDist and the standard deviation StdDev. If neither of the previous 2 options was picked, then we know that the user chose the final one, meaning the gamma-distribution and we set the wages of the people in that distribution.

After the individual wages have been determined, we calculate the average wage of each country. We sum the wages of all country1 residents and divide it by the number of country1 residents and then we do the same for country2.

The "go" function contains 4 procedures ("decide-by-yourOwn", "change-decisions", "move" and "do-plots"), a tick counter and an instruction for the go procedure to stop when the counter reaches 100, to imitate a human’s lifespan.

In "decide-by-yourOwn", we first assume that the people don’t want to move, then we revise that assumption. For the people that prefer higher wage, we check whether the net average wage from the country they are not in is higher – by percentage-higher – than their own net wage. If that is the case, the people will want to move to the other country.

For the people that prefer a higher pension, we check if the tax in the foreign country is higher than that in their country, always by percentage-higher. If that is the case and the person has more than 15 years of work before he/she can retire, than he/she decides to move. So, if the conditions of the other country are more advantageous, according to the preference of the turtle, then the person decides to move and turns red. Conversely, he/she turns blue if he/she is already in the favourite country.

In the "change-decisions" procedure every person looks at their neighbors in a radius of 5 around their patch, checks how many neighbors want to move and initializes the variable total with that number. Then, if more than a half of the neighbors has taken the decision to move, the turtle imitates the neighbors and sets its decision to 1 as well.

The next procedure in go is the one titled "move". As the name suggests, this is where all turtles that in the previous procedure decided to leave their country do so. Therefore, if the decision variable of a person is equal to 1 and if the person is in country 1, then he/she moves to one of the patches that comprise country 2. Similarly, if a red person is on a patch from country 2, then he/she moves to country 1.

In each realization of this procedure, all the people age – the variable yearsOld is incremented by one unit. The average wage for each country is again computed, in preparation for the next iteration of the code


PROCEDURES

globals [
  country1  ;; high pension country
  country2  ;; low pension country
  averagewage1
  averagewage2
]




turtles-own  [
  yearsold
  preference ;; 0 if she prefers high wage, 1 if she prefers high pension. tax is both tax and future pension
  decision   ;; 0 if they don't move 1 if they decide to move
  total
  yearsb4retirement ;; 0 if person is older than 65, 65-age if person is younger than 65
  wage
  ]


to setup
  clear-all
  setup-patches
  setup-turtles
end
  
to setup-patches
  ;; create the countries
  set country1 patches with [pxcor > 0]
  ask country1 [ set pcolor yellow ]
  set country2 patches with [pxcor <= 0]
  ask country2 [ set pcolor green ]
end

to setup-turtles
  ;; create characteristics for the agents
  set-default-shape turtles "person"
  crt number-people
  ask turtles
    [ set yearsOld random 100
      ifelse (yearsOld > 65) 
       [set yearsb4retirement 0]
       [set yearsb4retirement 65 - yearsOld]   
      
      set preference random 2   
      setxy random-xcor random-ycor
      ifelse preference = 0
       [set color white]
       [set color black]
      
      ;; a distribution for the wage is chosen 
      ifelse wage-distribution = "random-numbers" 
       [set wage random 10000]
       [ifelse wage-distribution = "normal-distribution" 
         [set wage random-normal meanDist StdDev]
         [set wage random-gamma alpha lambda]]  
    ]

   ;;  the average wages for the two countries are computed
   set averagewage1  (sum [ wage ] of turtles with [xcor > 0]) / (count turtles with [xcor > 0])
   set averagewage2  (sum [ wage ] of turtles with [xcor <= 0]) / (count turtles with [xcor <= 0]) 
  
end

to go
  decide-by-yourOwn
  change-decisions
  move
  do-plots
  tick
  if ticks = 100 [stop]
end

to decide-by-yourOwn  
    
  ask turtles   [set decision 0 set color blue] ;; 
  ask turtles [
  ;; if he wants high wage and he is from country1, but country2 wage is a certain percent higher than his own, he decides to move-decision 1
  ;; if he wants high wage and he is from country2, but country1 wage is a certain percent higher than his own, he decides to move-decision 1 
  if  ((preference = 0) and (wage * (1 - tax1)  * (percentage-higher + 1) < averagewage2 * (1 - tax2) ) and (xcor > 0)) 
      or ((preference = 0) and (wage *(1 - tax2)* (percentage-higher + 1)< averagewage1 * (1 - tax1)) and (xcor <= 0))
      [set decision 1 
       set color red]
      
  ;; if he prefers high pension and he is from country1, but country2 tax is a certain percent higher and he has more than 15 years until retirement, he decides to move-decision 1
  ;; if he prefers high pension and he is from country2, but country1 tax is a certain percent higher and he has more than 15 years until retirement, he decides to move-decision 1     
   if ((preference = 1) and  (tax1 *(percentage-higher + 1) < tax2) and (yearsb4retirement > 15) and (xcor > 0)) 
      or  ((preference = 1) and  (tax2 *(percentage-higher + 1) < tax1) and (yearsb4retirement > 15) and (xcor <= 0))
     [set decision 1 
      set color red]
  ]
  
end 
  
to change-decisions
  
  ask turtles [
   set total (count other turtles with [decision = 1] in-radius 5) ;; initialize variable total with number of neighbours that want to move
  ]

  ask turtles[
    if (total * 2 >= count other turtles in-radius 5 ) ;; if more than half of neighbours want to move, then the agent imitates them and wants to move as well 
    [set decision 1
     set color red]
  ]
end

to move
    
  ask turtles [   
    ;; if the agent has decided he wants to migrate/move, then he changes his country of residence
    ifelse (decision = 1) and (xcor > 0)   
    [move-to one-of country2]
    [ifelse (decision = 1) and (xcor <= 0)  
       [move-to one-of country1]
       []    ]
  ]
  ask turtles [ set yearsOld yearsOld + 1]
  
  ;; the average wages for each country are recalculated at the end of each migration cycle
  set averagewage1  (sum [ wage ] of turtles with [xcor > 0]) / (count turtles with [xcor > 0])
  set averagewage2  (sum [ wage ] of turtles with [xcor <= 0]) / (count turtles with [xcor <= 0])

end

to do-plots  
  set-current-plot "population"
  set-current-plot-pen "country1 residents"
  plot count turtles with [xcor > 0]
  set-current-plot-pen "country2 residents"
  plot count turtles with [xcor <= 0]
  set-current-plot "move"
  set-current-plot-pen "move"
  plot count turtles with [decision = 1]
  set-current-plot-pen "don't move"
  plot count turtles with [decision = 0]

end