The simulated dataset and conclusions.
4. Conclusion
The aim of the project was to create a data set by simulating a real-world phenomenon of our choosing. Then rather than collect data related to the phenomenon, model and synthesis such data using Python and the numpy.random
package.
In this notebook I first analysed an actual dataset for the phenomenon of World Happiness in order to understand the type of variables and the type of distributions they were likely to have come from and also to see how they were related to each other.
I then simulated the dataset, mainly using the numpy.random
package but exploring some functionality from the scikit-learn package.
Finally I compared the results of the simulation to a real world dataset.
I believe the synthesised dataset closely matches the actual dataset. The results will change each time the code is run as the random seed is not set. In reality data samples would also vary from sample to sample due to randomness.
The dataset was a little more complicated that it first appeared to be, given the regional variation and also variation within regions. Given that the number of datapoints for a dataset such as this is limited, the number of datapoints that could be simulated is limited but I am satisfied with the results. Overall this project was a very good learning experience. It was also very eye-opening to see the levels of inequality across the globe.
The last section below lists the references used for this project.
The simulated dataset:
Country | Life_Satisfaction | Log_GDP_per_cap | Social_Support | Life_Expectancy | Group | |
---|---|---|---|---|---|---|
0 | Sim_Country_0 | 5.306706 | 8.921793 | 0.787441 | 66.048883 | Group0 |
1 | Sim_Country_1 | 5.651307 | 8.654395 | 0.809210 | 66.436883 | Group0 |
2 | Sim_Country_2 | 5.661618 | 9.308995 | 0.693635 | 63.622131 | Group0 |
3 | Sim_Country_3 | 4.861526 | 10.605480 | 0.782290 | 64.910602 | Group0 |
4 | Sim_Country_4 | 5.348437 | 9.782862 | 0.785385 | 66.617080 | Group0 |
5 | Sim_Country_5 | 5.128717 | 9.817910 | 0.760056 | 57.921714 | Group0 |
6 | Sim_Country_6 | 5.269363 | 10.109246 | 0.761935 | 68.399157 | Group0 |
7 | Sim_Country_7 | 6.501682 | 8.112212 | 0.754724 | 64.210712 | Group0 |
8 | Sim_Country_8 | 4.775925 | 9.228186 | 0.698084 | 69.355376 | Group0 |
9 | Sim_Country_9 | 5.774356 | 8.475127 | 0.772971 | 66.751545 | Group0 |
10 | Sim_Country_10 | 4.878215 | 9.583725 | 1.053083 | 64.910144 | Group0 |
11 | Sim_Country_11 | 4.971545 | 9.843221 | 0.876955 | 66.535709 | Group0 |
12 | Sim_Country_12 | 5.041377 | 8.237230 | 0.935270 | 65.121138 | Group0 |
13 | Sim_Country_13 | 5.157232 | 9.935217 | 0.914311 | 66.977529 | Group0 |
14 | Sim_Country_14 | 5.105177 | 9.051786 | 0.822069 | 65.698418 | Group0 |
15 | Sim_Country_15 | 5.529221 | 8.909552 | 0.808504 | 69.575341 | Group0 |
16 | Sim_Country_16 | 6.112835 | 10.098701 | 0.645022 | 67.533733 | Group0 |
17 | Sim_Country_17 | 5.085967 | 9.902266 | 0.828094 | 69.822780 | Group0 |
18 | Sim_Country_18 | 6.106302 | 8.647881 | 0.892219 | 63.468165 | Group0 |
19 | Sim_Country_19 | 6.668034 | 8.887026 | 0.729624 | 64.394763 | Group0 |
20 | Sim_Country_20 | 4.029621 | 10.779107 | 0.683975 | 66.856696 | Group0 |
21 | Sim_Country_21 | 5.057753 | 7.962426 | 0.754665 | 65.793576 | Group0 |
22 | Sim_Country_22 | 5.851524 | 10.127415 | 0.908542 | 62.503728 | Group0 |
23 | Sim_Country_23 | 6.002350 | 8.352002 | 0.863631 | 68.506211 | Group0 |
24 | Sim_Country_24 | 5.654982 | 8.802262 | 0.693322 | 64.873640 | Group0 |
25 | Sim_Country_25 | 5.253160 | 9.731938 | 0.729333 | 61.137760 | Group0 |
26 | Sim_Country_26 | 5.041206 | 9.819737 | 0.857276 | 61.731023 | Group0 |
27 | Sim_Country_27 | 5.131967 | 8.575882 | 0.721815 | 65.468924 | Group0 |
28 | Sim_Country_28 | 6.445590 | 8.746669 | 1.001303 | 61.517664 | Group0 |
29 | Sim_Country_29 | 5.824301 | 9.300203 | 0.848021 | 62.704594 | Group0 |
30 | Sim_Country_30 | 5.016133 | 9.535686 | 0.969046 | 64.939119 | Group0 |
0 | Sim_Country_0 | 4.671344 | 6.724028 | 0.641005 | 50.339410 | Group1 |
1 | Sim_Country_1 | 4.761840 | 7.475304 | 0.676521 | 54.053141 | Group1 |
2 | Sim_Country_2 | 5.851653 | 8.594777 | 0.591575 | 52.256857 | Group1 |
3 | Sim_Country_3 | 4.299704 | 9.815454 | 0.723505 | 54.739286 | Group1 |
4 | Sim_Country_4 | 4.526663 | 8.752159 | 0.649671 | 53.802220 | Group1 |
5 | Sim_Country_5 | 4.665746 | 7.702158 | 0.580355 | 54.713613 | Group1 |
6 | Sim_Country_6 | 3.280790 | 9.497792 | 0.762002 | 52.950554 | Group1 |
7 | Sim_Country_7 | 4.332600 | 6.549067 | 0.544959 | 57.401968 | Group1 |
8 | Sim_Country_8 | 5.037402 | 7.993202 | 0.769817 | 57.928439 | Group1 |
9 | Sim_Country_9 | 5.279576 | 5.872378 | 0.625565 | 54.165948 | Group1 |
10 | Sim_Country_10 | 4.079668 | 9.248135 | 0.699928 | 48.970274 | Group1 |
11 | Sim_Country_11 | 3.434483 | 7.180820 | 0.736100 | 53.631864 | Group1 |
12 | Sim_Country_12 | 4.730052 | 7.865161 | 0.640194 | 61.551827 | Group1 |
13 | Sim_Country_13 | 4.417993 | 7.366929 | 0.588115 | 58.964043 | Group1 |
14 | Sim_Country_14 | 4.777392 | 8.975000 | 0.557432 | 57.160128 | Group1 |
15 | Sim_Country_15 | 5.205033 | 9.592819 | 0.535112 | 58.096569 | Group1 |
16 | Sim_Country_16 | 4.500506 | 9.300303 | 0.727104 | 57.704147 | Group1 |
17 | Sim_Country_17 | 6.082710 | 8.887950 | 0.574452 | 57.281150 | Group1 |
18 | Sim_Country_18 | 4.474548 | 6.565864 | 0.578081 | 57.996228 | Group1 |
19 | Sim_Country_19 | 4.242393 | 8.207752 | 0.678505 | 56.065283 | Group1 |
20 | Sim_Country_20 | 4.304773 | 7.727857 | 0.576695 | 55.615156 | Group1 |
21 | Sim_Country_21 | 5.312878 | 7.398653 | 0.697577 | 58.870289 | Group1 |
22 | Sim_Country_22 | 4.152087 | 7.470080 | 0.664083 | 54.883122 | Group1 |
23 | Sim_Country_23 | 3.511708 | 7.626213 | 0.630826 | 54.703135 | Group1 |
24 | Sim_Country_24 | 4.087854 | 8.349840 | 0.808642 | 55.791146 | Group1 |
25 | Sim_Country_25 | 5.516232 | 6.010996 | 0.751711 | 59.558816 | Group1 |
26 | Sim_Country_26 | 4.374513 | 8.275585 | 0.641192 | 53.109696 | Group1 |
27 | Sim_Country_27 | 3.513561 | 7.199095 | 0.668894 | 54.240348 | Group1 |
28 | Sim_Country_28 | 4.548910 | 9.169545 | 0.554520 | 57.026642 | Group1 |
29 | Sim_Country_29 | 5.000956 | 7.773946 | 0.671258 | 50.538825 | Group1 |
30 | Sim_Country_30 | 4.800033 | 7.991752 | 0.609611 | 57.686102 | Group1 |
31 | Sim_Country_31 | 4.019863 | 9.271410 | 0.559175 | 55.289283 | Group1 |
32 | Sim_Country_32 | 3.906991 | 8.715052 | 0.687227 | 57.173227 | Group1 |
33 | Sim_Country_33 | 6.220091 | 8.392975 | 0.736993 | 58.125733 | Group1 |
34 | Sim_Country_34 | 4.318359 | 7.791876 | 0.655685 | 54.456182 | Group1 |
35 | Sim_Country_35 | 4.904859 | 8.355346 | 0.576573 | 58.568376 | Group1 |
36 | Sim_Country_36 | 5.592356 | 6.747997 | 0.658175 | 59.476083 | Group1 |
37 | Sim_Country_37 | 4.909638 | 7.444697 | 0.721786 | 51.673735 | Group1 |
38 | Sim_Country_38 | 4.673152 | 7.425028 | 0.586048 | 55.680735 | Group1 |
0 | Sim_Country_0 | 6.650582 | 10.486408 | 0.957040 | 71.204546 | Group2 |
1 | Sim_Country_1 | 5.948507 | 10.530889 | 0.832581 | 70.661832 | Group2 |
2 | Sim_Country_2 | 7.115427 | 9.467759 | 0.945339 | 69.148849 | Group2 |
3 | Sim_Country_3 | 5.896939 | 11.135984 | 0.843904 | 73.312323 | Group2 |
4 | Sim_Country_4 | 5.581362 | 11.543183 | 0.907253 | 69.451951 | Group2 |
5 | Sim_Country_5 | 7.090332 | 10.213221 | 0.861714 | 63.705882 | Group2 |
6 | Sim_Country_6 | 7.570644 | 9.985238 | 0.972682 | 71.646964 | Group2 |
7 | Sim_Country_7 | 6.936207 | 10.711594 | 0.930214 | 67.391960 | Group2 |
8 | Sim_Country_8 | 6.683955 | 10.716176 | 0.911880 | 77.238667 | Group2 |
9 | Sim_Country_9 | 7.510457 | 9.937862 | 0.840780 | 70.116599 | Group2 |
10 | Sim_Country_10 | 7.159937 | 10.849546 | 0.819747 | 73.947126 | Group2 |
11 | Sim_Country_11 | 6.670528 | 9.869081 | 1.004287 | 70.925823 | Group2 |
12 | Sim_Country_12 | 5.691150 | 10.361646 | 0.908960 | 71.747314 | Group2 |
13 | Sim_Country_13 | 6.039334 | 9.247191 | 0.958541 | 72.298442 | Group2 |
14 | Sim_Country_14 | 6.454486 | 10.316801 | 0.861675 | 71.337509 | Group2 |
15 | Sim_Country_15 | 6.331236 | 11.105422 | 0.927258 | 72.221305 | Group2 |
16 | Sim_Country_16 | 5.351351 | 10.196518 | 0.813308 | 71.521464 | Group2 |
17 | Sim_Country_17 | 6.968510 | 10.605107 | 0.805385 | 74.367682 | Group2 |
18 | Sim_Country_18 | 6.848621 | 10.714149 | 0.903825 | 73.188295 | Group2 |
19 | Sim_Country_19 | 6.421923 | 9.681545 | 0.907251 | 72.737426 | Group2 |
20 | Sim_Country_20 | 6.944172 | 10.897829 | 0.893933 | 71.432948 | Group2 |
21 | Sim_Country_21 | 6.104733 | 11.312868 | 0.859266 | 71.270826 | Group2 |
22 | Sim_Country_22 | 5.971745 | 11.616137 | 0.910276 | 72.727849 | Group2 |
23 | Sim_Country_23 | 8.433459 | 10.599189 | 0.894080 | 74.493444 | Group2 |
24 | Sim_Country_24 | 6.432378 | 10.786862 | 0.888852 | 72.331226 | Group2 |
25 | Sim_Country_25 | 6.213734 | 10.604391 | 0.915690 | 68.635093 | Group2 |
26 | Sim_Country_26 | 6.012344 | 10.081934 | 0.813485 | 72.344020 | Group2 |
27 | Sim_Country_27 | 6.859502 | 10.534599 | 0.910122 | 70.365875 | Group2 |
28 | Sim_Country_28 | 7.972533 | 10.308342 | 0.908386 | 69.974966 | Group2 |
29 | Sim_Country_29 | 6.226960 | 10.723157 | 0.909400 | 71.627059 | Group2 |
30 | Sim_Country_30 | 5.958528 | 10.651351 | 0.938047 | 71.121344 | Group2 |
31 | Sim_Country_31 | 5.856611 | 11.501646 | 0.900802 | 73.917783 | Group2 |
32 | Sim_Country_32 | 5.838465 | 10.547440 | 0.972957 | 72.531078 | Group2 |
33 | Sim_Country_33 | 8.860939 | 10.577834 | 0.920326 | 71.458597 | Group2 |
34 | Sim_Country_34 | 7.026720 | 10.560634 | 1.023850 | 72.052767 | Group2 |
35 | Sim_Country_35 | 7.927715 | 10.396347 | 0.958713 | 73.626023 | Group2 |
36 | Sim_Country_36 | 5.767130 | 10.177779 | 0.940705 | 69.391173 | Group2 |
37 | Sim_Country_37 | 5.877582 | 10.433927 | 0.824850 | 72.478332 | Group2 |
38 | Sim_Country_38 | 6.007317 | 10.808531 | 0.818562 | 67.894686 | Group2 |
39 | Sim_Country_39 | 6.752764 | 10.738708 | 0.968577 | 74.145574 | Group2 |
40 | Sim_Country_40 | 7.317622 | 10.293289 | 0.798077 | 70.073409 | Group2 |
41 | Sim_Country_41 | 5.573241 | 10.029195 | 0.897342 | 70.913134 | Group2 |
42 | Sim_Country_42 | 7.610233 | 10.279829 | 0.889985 | 72.556180 | Group2 |
43 | Sim_Country_43 | 7.061405 | 10.079536 | 0.866913 | 71.741196 | Group2 |
44 | Sim_Country_44 | 7.011454 | 10.081431 | 0.916591 | 67.124498 | Group2 |
45 | Sim_Country_45 | 8.151749 | 9.806227 | 0.946049 | 71.236996 | Group2 |
46 | Sim_Country_46 | 7.901804 | 10.574144 | 0.878869 | 72.038218 | Group2 |
47 | Sim_Country_47 | 6.227294 | 9.934210 | 0.906127 | 69.434784 | Group2 |
48 | Sim_Country_48 | 7.206467 | 10.495159 | 0.880406 | 73.246613 | Group2 |
49 | Sim_Country_49 | 7.351988 | 10.415570 | 0.900912 | 70.182151 | Group2 |
50 | Sim_Country_50 | 6.638009 | 9.901553 | 0.783736 | 73.867776 | Group2 |
51 | Sim_Country_51 | 5.569607 | 10.346279 | 0.890414 | 71.811613 | Group2 |
52 | Sim_Country_52 | 6.862937 | 10.019423 | 0.928102 | 71.754594 | Group2 |
53 | Sim_Country_53 | 5.862264 | 10.268521 | 0.907081 | 71.617507 | Group2 |
54 | Sim_Country_54 | 6.288760 | 11.645804 | 0.942329 | 76.936191 | Group2 |
55 | Sim_Country_55 | 6.509125 | 10.598213 | 0.901340 | 70.859460 | Group2 |