Tick 3. Plotting experimental results

What is the relationship between inequality and social mobility? Is there a tradeoff? To investigate this, I have run simulations with different levels of taxation, which I would expect to alter both inequality and mobility.

Concretely, I used the Value Transfer exchange model mentioned at the end of Tick 1; and I additionally suppose the government imposes a tax of say 40% on every exchange, and each timestep it redistributes the total tax revenue evenly to the entire population as uniform basic income.

I have run 20 simulation runs at each of 7 different tax rates, giving 140 simulation runs in total. In each run I ran the simulator for $T=5000$ timesteps, by which time it had reached stability. I measured the Gini coefficient at time $T$. I then ran the simulator for a further 100 timesteps and for each time $t\geq 5000$ I measured $\textsf{mobility}(w_T, w_{T+t})$. The data I produced is available in two files, shown here with some sample rows:

https://www.cl.cam.ac.uk/teaching/2223/SciComp/data/taxubi_summary.csv
run taxrate metric time value
3 0.01 mobility 5025 0.27796
61 0.15 gini 5000 0.964572
76 0.15 mobility 5090 0.41828
...
https://www.cl.cam.ac.uk/teaching/2223/SciComp/data/taxubi_sample.csv
run taxrate time person_id wealth
0 0.01 5078 2 0.000344682
0 0.01 5092 4 2.34652e-05
120 0.4 5066 2 0.262878
...

The first file records Gini coefficient and mobility in the value column. The second file picks out two of the runs, and a random sample of 10 individuals, and records their wealth at each timepoint $t\geq 5000$.

Questions

For this tick, you are asked to produce plots. Please submit two things: (1) a single-page pdf with all three plots, and (2) your notebook.

Question 10. Plot social mobility as a function of time, showing the runs for tax rates 1% and 40%. For each tax rate you should plot 20 lines, one for each simulation run. Also, plot horizontal guidelines at 48% and at 24%.

Your plot should look something like this. You don't have to reproduce it exactly, but you should pay attention to (1) using two different colours, (2) adjusting opacity so the lines aren't occluded, (3) showing the legend. Don't worry about fine-grained control of the plot, such as plot size or colour scheme.

Question 11. It's useful to ‘eyeball’ the data — to look in detail at some individual cases, to get a better picture of what's going on. Plot the rank of each individual's wealth (rank 1 is wealthiest, rank 10 is poorest) for the two simulation runs in taxubi_sample.csv.

Your plot should look something like this. You don't have to reproduce it exactly, but you should pay attention to (1) colouring the lines according to wealth-rank at time $T=5000$, (2) the y-axis which has rank 1 at the top, (3) appropriate titles. Don't worry about fine-grained control of the plot, such as plot size or colour scheme.

Question 12. To show how tax rate affects inequality and social mobility, produce the following scatter plot. There should be one point plotted for each tax rate. Its x-coordinate should be the average Gini coefficient over 20 runs, and its y-coordinate should be the average number of timesteps needed to achieve mobility of 24%. For each point plotted, in addition to the mean, there should be x-error-bars and y-error-bars to show the variability between simulation runs.

Your plot should look something like this. You don't have to reproduce it exactly: don't worry about fine-grained control of the plot, such as plot size or colour scheme. This plot shows error bars in red, but they are so small as to be hard to make out. You should pay attention to the legibility of the labelling.