-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathParameters.java
More file actions
3352 lines (2854 loc) · 187 KB
/
Parameters.java
File metadata and controls
3352 lines (2854 loc) · 187 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// define package
package simpaths.data;
// import Java packages
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.*;
// import plug-in packages
import simpaths.data.startingpop.DataParser;
import simpaths.model.AnnuityRates;
import simpaths.model.enums.*;
import org.apache.commons.collections4.keyvalue.MultiKey;
import org.apache.commons.collections4.map.LinkedMap;
import org.apache.commons.collections4.map.MultiKeyMap;
import org.apache.commons.lang3.tuple.Triple;
import org.apache.commons.math3.distribution.MultivariateNormalDistribution;
import org.apache.commons.math3.distribution.NormalDistribution;
import org.apache.commons.math3.util.Pair;
// import JAS-mine packages
import microsim.data.excel.ExcelAssistant;
import microsim.data.MultiKeyCoefficientMap;
import microsim.statistics.regression.*;
// import LABOURsim packages
import simpaths.model.taxes.DonorTaxUnit;
import simpaths.model.decisions.Grids;
import simpaths.model.taxes.MatchFeature;
import simpaths.model.taxes.database.TaxDonorDataParser;
import static microsim.statistics.regression.RegressionUtils.appendCoefficientMaps;
/**
*
* CLASS TO STORE MODEL PARAMETERS FOR GLOBAL ACCESS
*
*/
public class Parameters {
public static final boolean TESTING_FLAG = false;
// EUROMOD variables
// Insert here names of EUROMOD variables to use in Person and BenefitUnit tables of the input database
// NOTE: The model economises set-up costs for the donor population by considering policy projections generated
// for multiple "system years" for the same input data. All non-financial statistics should consequently be the
// same for the donor population (described under DONOR_STATIC_VARIABLES). Memory is further economised by assuming
// a constant inflation adjustment for all factors in EUROMOD, so that exogenous financial inputs vary by system year
// only by the inflation rate. Setting this rate to the rate of inflation loaded in via scenario_uprating_factor.xls
// permits these exogenous inputs to be inferred across system years without storing them separately for each year
// The only financial statistics that vary by system should consequently be policy dependant variables,
// (described below under DONOR_POLICY_VARIABLES). The model performs checks to ensure that these conditions are
// met when it loads in data.
public static final String[] DONOR_STATIC_VARIABLES = new String[] {
"idhh", //id of household
"idperson", //id of person
"idfather", //id of father
"idmother", //id of mother
"idpartner", //id of partner
"dag", //age
"dct", //country
"deh", //highest education level
"dgn", //gender
"drgn1", //region (NUTS1)
"dwt", //household weight
"les", //labour employment status + health status
"lcs", //labour civil servant dummy indicator
"lcr01", //carer status for benefits (0 no 1 yes)
"lhw", //hours worked per week
"ddi", //disability status
"yem", //employment income - used to construct work sector *NOT VALID FOR POLICY ANALYSIS*
"yse", //self-employment income - used to construct work sector *NOT VALID FOR POLICY ANALYSIS*
};
public static final String[] DONOR_POLICY_VARIABLES = new String[] {
"xcc", //childcare costs
"ils_earns", //EUROMOD output variable:- total labour earnings (employment + self-employment income + potentially other labour earnings like temporary employment, depending on country classification)
"ils_origy", //EUROMOD output variable:- all gross income from labour, private pensions, investment income, property income, private transfers etc.
"ils_dispy", //Disposable income : from EUROMOD output data after tax / benefit transfers (monthly time-scale)
"ils_benmt", //EUROMOD output variable: income list: monetary benefits
"ils_bennt", //EUROMOD output variable: income list: non-monetary benefits
};
public static final String[] HOUSEHOLD_VARIABLES_INITIAL = new String[] {
"idhh", //id of household (can contain multiple benefit units)
};
public static final String[] BENEFIT_UNIT_VARIABLES_INITIAL = new String[] {
"idhh", //id of household (can contain multiple benefit units)
"idbenefitunit", //id of a benefit unit
"drgn1", //region (NUTS1)
"ydses_c5", //household income quantile
"dhh_owned", //flag indicating if benefit unit owns a house
"liquid_wealth", //benefit unit net wealth non-pension non-housing wealth
"tot_pen", //benefit unit net pension wealth
"nvmhome", //benefit unit net housing wealth
};
public static final String[] PERSON_VARIABLES_INITIAL = new String[] {
"idhh", //id of household (can contain multiple benefit units)
"idbenefitunit", //id of a benefit unit
"idperson", //id of person
"dwt", //household weight
"idfather", //id of father
"idmother", //id of mother
"dag", //age
"deh_c3", //highest education level
"dehm_c3", //highest education level of mother
"dehf_c3", //highest education level of father
"ded", //in education dummy
"der", //return to education dummy
"dhe", //health status
"dhm", //mental health status
"scghq2_dv", //mental health status case based
"dhm_ghq", //mental health status case based dummy (1 = psychologically distressed)
"dls", //life satisfaction
"dhe_mcs", //mental health - SF12 score MCS
"dhe_pcs", //physical health - SF12 score PCS
"dcpyy", //years in partnership
"dcpagdf", //partners age difference
"dnc02", //number children aged 0-2
"dnc", //number children
"ypnbihs_dv", //gross personal non-benefit income
"yptciihs_dv", //gross personal non-employment non-benefit income
"ypncp", //gross personal capital income
"ypnoab", //gross personal pension (public / occupational) income
"yplgrs_dv", //gross personal employment income
"ynbcpdf_dv", //difference partner income
"dlltsd", //long-term sick or disabled
"sedex", //year left education
"stm", //system variable - year
"swv", //system variable - wave
"dgn", //gender
"les_c4", //labour employment status
"lhw", //hours worked per week
"adultchildflag", //flag indicating adult child living at home in the data
"dhh_owned", //flag indicating if individual is a homeowner
"potential_earnings_hourly", //initial value of hourly earnings from the data
"l1_potential_earnings_hourly", //lag(1) of initial value of hourly earnings from the data
"need_socare", //indicator that the individual needs social care
"formal_socare_hrs", //number of hours of formal care received
"formal_socare_cost", //cost of formal care received
"partner_socare_hrs", //number of hours of informal care received from partner
"daughter_socare_hrs", //number of hours of informal care received from daughter
"son_socare_hrs", //number of hours of informal care received from son
"other_socare_hrs", //number of hours of informal care received from other
"aidhrs", //number of hours of informal care provided (total)
"careWho" //indicator for whom informal care is provided
//"yem", //employment income
//"yse", //self-employment income
//From EUROMOD output data before tax / benefit transfers, so not affected by EUROMOD policy scenario (monthly time-scale). We just use them calculated from EUROMOD output because EUROMOD has the correct way of aggregating each country's different component definitions
//"ils_earns", //EUROMOD output variable:- total labour earnings (employment + self-employment income + potentially other labour earnings like temporary employment, depending on country classification)
//"ils_origy" //EUROMOD output variable:- all gross income from labour, private pensions, investment income, property income, private transfers etc.
};
//Parameters for managing tax and benefit imputations
public static final int TAXDB_REGIMES = 5;
private static Map<MatchFeature, Map<Integer, Integer>> taxdbCounter = new HashMap<MatchFeature, Map<Integer, Integer>>(); // records, for each of the three donor keys (first Integer), the increments (second Integer) associated with one unit change in characteristic (String). The properties of taxdbCounter are specific to the KeyFunction used (and are populated by the associated function)
private static List<DonorTaxUnit> donorPool; // list of donors for tax imputation, in ascending order by private (original) income
private static Map<Triple<Integer,Integer,Integer>,List<Integer>> taxdbReferences = new HashMap<>(); // for Triple <system year, matching regime, regime index> returns a list of indices to donorPool that describes members of grouping, in ascending order by private income
private static MahalanobisDistance mdDualIncome;
private static MahalanobisDistance mdChildcare;
private static MahalanobisDistance mdDualIncomeChildcare;
//Labour Demand/Supply Convergence parameters
public static final double INITIAL_DECAY_FACTOR = 1.; //Initialisation of field that is used to check whether labour market equilibrium is progressing fast enough (is multiplied by a factor at each iteration when needed, so the factor gets exponentially smaller)
public static final DemandAdjustment demandAdjustment = DemandAdjustment.PopulationGrowth; //Choose the method by which we derive the factor applied to the converged labour demand in order to get the initial labour demand at the following timestep
public static final double ETA = 0.2; //(eta in Matteo's document). If excess labour demand is greater than this value (0.1 == 10%), then iterate convergence procedure again
public static final double CHI_minus = 0.1; //Lambda in Matteo's document is adjusted by reducing by lambda -> lambda * (1 - CHI_minus), or increasing lambda by lambda -> lambda * (1 + CHI_plus)
public static final double CHI_plus = 0.1; //Lambda in Matteo's document is adjusted by reducing by lambda -> lambda * (1 - CHI_minus), or increasing lambda by lambda -> lambda * (1 + CHI_plus)
public static final Map<Education, Double> adjustmentFactorByEducation; //Lambda_s in Matteo's document, where s is the education level
public static final double initialLambda = ETA/5.; //Ensure adjustment is smaller than relative excess labour demand threshold
public static final int MinimumIterationsBeforeTestingConvergenceCriteria = 20; //Run this number of iterations to accumulate estimates of (aggregate) labour supply (cross) elasticities before testing the convergence criterion (i.e. the norm of (supply * demand elasticities) matrix < 1)
public static final int MaxConvergenceAttempts = 2 * MinimumIterationsBeforeTestingConvergenceCriteria; //Allow the equilibrium convergence criterion to fail the test this number of times before potentially terminating the simulation.
public static final double RateOfConvergenceFactor = 0.9;
// parameters to manage simulation of optimised decisions
public static boolean projectLiquidWealth = false;
public static boolean projectPensionWealth = false;
public static boolean projectHousingWealth = false;
public static boolean enableIntertemporalOptimisations = false;
public static Grids grids = null;
static {
adjustmentFactorByEducation = new LinkedHashMap<Education, Double>(); //Initialise adjustment factor to the same value for all education levels
for (Education edu: Education.values()) {
adjustmentFactorByEducation.put(edu, initialLambda);
}
}
public static void resetAdjustmentFactorByEducation() {
for(Education edu: Education.values()) {
adjustmentFactorByEducation.put(edu, initialLambda);
}
}
public static final double childrenNumDiscrepancyConstraint(double numberOfChildren) {
if(numberOfChildren <= 1) {
return 0.;
}
else if(numberOfChildren <= 3) {
return 1.;
}
else if(numberOfChildren <= 5) {
return 2.;
}
else {
return 3.;
}
}
public static final double AgeDiscrepancyConstraint = 10; //Difference of age must equal of be below this value (so we allow 10 year cumulated age difference)
public static final TreeSet<Double> EarningsDiscrepancyConstraint = new TreeSet<>(Arrays.asList(0.01, 0.02, 0.03, 0.04, 0.05)); //Proportional difference
//Initial matching differential bounds - the initial bounds that a match must satisfy, before being relaxed
public static final double UNMATCHED_TOLERANCE_THRESHOLD = 0.1; //Smallest proportion of a gender left unmatched (we take the minimum of the male proportion and female proportions). If there are more than this, we will relax the constraints (e.g. the bounds on age difference and potential earnings difference) until this target has been reached
public static final int MAXIMUM_ATTEMPTS_MATCHING = 10;
public static final double RELAXATION_FACTOR = 1.5;
public static final int AGE_DIFFERENCE_INITIAL_BOUND = 999;
public static final double POTENTIAL_EARNINGS_DIFFERENCE_INITIAL_BOUND = 999.;
public static final double WEEKS_PER_MONTH = 365.25/(7.*12.); // = 4.348214286
public static final double WEEKS_PER_YEAR = 365.25 / 7.;
public static final int HOURS_IN_WEEK = 24 * 7; //This is used to calculate leisure in labour supply
//Is it possible for people to start going to the labour module (e.g. age 17) while they are living with parents (until age 18)?
//Cannot see how its possible if it is the household that decides how much labour to supply. If someone finishes school at 17, they need to leave home before they can enter the labour market. So set age for finishing school and leaving home to 18.
public static final int MAX_LABOUR_HOURS_IN_WEEK = 48;
public static final boolean USE_CONTINUOUS_LABOUR_SUPPLY_HOURS = true; // If true, a random number of hours of weekly labour supply within each bracket will be generated. Otherwise, each discrete choice of labour supply corresponds to a fixed number of hours of labour supply, which is the same for all persons
public static int maxAge; // maximum age possible in simulation
public static final int AGE_TO_BECOME_RESPONSIBLE = 18; // Age become reference person of own benefit unit
public static final int MIN_AGE_TO_LEAVE_EDUCATION = 16; // Minimum age for a person to leave (full-time) education
public static final int MAX_AGE_TO_LEAVE_CONTINUOUS_EDUCATION = 29;
public static final int MAX_AGE_TO_ENTER_EDUCATION = 45;
public static final int MIN_AGE_COHABITATION = AGE_TO_BECOME_RESPONSIBLE; // Min age a person can marry
public static final int MIN_AGE_TO_HAVE_INCOME = 16; //Minimum age to have non-employment non-benefit income
public static final int MIN_AGE_TO_RETIRE = 50; //Minimum age to consider retirement
public static final int DEFAULT_AGE_TO_RETIRE = 67; //if pension included, but retirement decision not
public static final int MIN_AGE_FORMAL_SOCARE = 65; //Minimum age to receive formal social care
public static final int MIN_AGE_FLEXIBLE_LABOUR_SUPPLY = 16; //Used when filtering people who can be "flexible in labour supply"
public static final int MAX_AGE_FLEXIBLE_LABOUR_SUPPLY = 75;
public static final double SHARE_OF_WEALTH_TO_ANNUITISE_AT_RETIREMENT = 0.25;
public static final double ANNUITY_RATE_OF_RETURN = 0.015;
public static AnnuityRates annuityRates;
public static final int MIN_HOURS_FULL_TIME_EMPLOYED = 25; // used to distinguish full-time from part-time employment (needs to be consistent with Labour enum)
public static final double MIN_HOURLY_WAGE_RATE = 1.5;
public static final double MAX_HOURLY_WAGE_RATE = 150.0;
public static final double MAX_HOURS_WEEKLY_FORMAL_CARE = 150.0;
public static final double MAX_HOURS_WEEKLY_INFORMAL_CARE = 16 * 7;
public static final double CHILDCARE_COST_EARNINGS_CAP = 0.5; // maximum share of earnings payable as childcare (for benefit units with some earnings)
public static final int MIN_DIFFERENCE_AGE_MOTHER_CHILD_IN_ALIGNMENT = 15; //When assigning children to mothers in the population alignment, specify how much older (at the minimum) the mother must be than the child
public static final int MAX_EM_DONOR_RATIO = 3; // Used by BenefitUnit => convertGrossToDisposable() to decide whether gross-to-net ratio should be applied or disposable income from the donor used directly
public static final double PERCENTAGE_OF_MEDIAN_EM_DONOR = 0.2; // Used by BenefitUnit => convertGrossToDisposable() to decide whether gross-to-net ratio should be applied or disposable income from the donor used directly
public static final double PSYCHOLOGICAL_DISTRESS_GHQ12_CASES_CUTOFF = 4; // Define cut-off on the GHQ12 Likert scale above which individuals are classified as psychologically distressed
//Initial value for the savings rate and multiplier for capital income:
public static double SAVINGS_RATE; //This is set in the country-specific part of this file
//public static int MAX_AGE_IN_EDUCATION;// = MAX_AGE;//30; // Max age a person can stay in education //Cannot set here, as MAX_AGE is not known yet. Now set to MAX_AGE in buildObjects in Model class.
//public static int MAX_AGE_MARRIAGE;// = MAX_AGE;//75; // Max age a person can marry //Cannot set here, as MAX_AGE is not known yet. Now set to MAX_AGE in buildObjects in Model class.
private static int MIN_START_YEAR = 2011; //Minimum allowed starting point. Should correspond to the oldest initial population.
private static int MAX_START_YEAR = 2021; //Maximum allowed starting point. Should correspond to the most recent initial population.
public static int startYear;
public static int endYear;
private static final int MIN_START_YEAR_TESTING = 2019;
private static final int MAX_START_YEAR_TESTING = 2019; //Maximum allowed starting point. Should correspond to the most recent initial population.
private static final int MIN_START_YEAR_TRAINING = 2019;
private static final int MAX_START_YEAR_TRAINING = 2019; //Maximum allowed starting point. Should correspond to the most recent initial population.
public static final int MIN_AGE_MATERNITY = 18; // Min age a person can give birth
public static final int MAX_AGE_MATERNITY = 44; // Max age a person can give birth
public static final boolean FLAG_SINGLE_MOTHERS = true;
public static boolean flagUnemployment = false;
public static int BASE_PRICE_YEAR = 2015; // Base price year of model parameters
public static double PROB_NEWBORN_IS_MALE = 0.5; // Must be strictly greater than 0.0 and less than 1.0
public static final boolean systemOut = true;
//Bootstrap all the regression coefficients if true, or only the female labour participation regressions when false
public static final boolean bootstrapAll = false;
//Scheduling
public static final int MODEL_ORDERING = 0;
public static final int COLLECTOR_ORDERING = 1; //-2
public static final int OBSERVER_ORDERING = 2; //-1
//Initialise values specifying domain of original sick probability curves
public static int femaleMinAgeSick = Integer.MAX_VALUE;
public static int maleMinAgeSick = Integer.MAX_VALUE;
public static int femaleMaxAgeSick = Integer.MIN_VALUE;
public static int maleMaxAgeSick = Integer.MIN_VALUE;
//For use with EUROMOD and h2 input database construction
public static final String WORKING_DIRECTORY = System.getProperty("user.dir");
public static final String INPUT_DIRECTORY = WORKING_DIRECTORY + File.separator + "input" + File.separator;
public static boolean trainingFlag = false;
public static final String INPUT_DIRECTORY_INITIAL_POPULATIONS = INPUT_DIRECTORY + "InitialPopulations" + File.separator; //Path to directory containing initial population for each year
public static final String EUROMOD_OUTPUT_DIRECTORY = INPUT_DIRECTORY + "EUROMODoutput" + File.separator;
public static final String EUROMOD_TRAINING_DIRECTORY = EUROMOD_OUTPUT_DIRECTORY + "training" + File.separator;
public static final String EUROMODpolicyScheduleFilename = "EUROMODpolicySchedule";
public static final String DatabaseCountryYearFilename = "DatabaseCountryYear";
//Headings in Excel file of EUROMOD policy scenarios
public static final String EUROMODpolicyScheduleHeadingFilename = "Filename";
public static final String EUROMODpolicyScheduleHeadingScenarioSystemYear = "Policy_System_Year";
public static final String EUROMODpolicyScheduleHeadingScenarioYearBegins = "Policy_Start_Year";
public static final String EUROMODpolicySchedulePlanHeadingDescription = "Description";
//Names of donor attributes that depend on EUROMOD policy parameters
public static final String DISPOSABLE_INCOME_VARIABLE_NAME = "DISPOSABLE_INCOME_MONTHLY";
public static final String EMPLOYER_SOCIAL_INSURANCE_VARIABLE_NAME = "EMPLOYER_SOCIAL_INSURANCE_CONTRIBUTION_PER_HOUR";
public static final String GROSS_EARNINGS_VARIABLE_NAME = "GROSS_EARNINGS_MONTHLY";
public static final String ORIGINAL_INCOME_VARIABLE_NAME = "ORIGINAL_INCOME_MONTHLY";
public static final String HOURLY_WAGE_VARIABLE_NAME = "HOURLY_WAGE";
public static final String ILS_BENMT_NAME = "ILS_BENMT";
public static final String ILS_BENNT_NAME = "ILS_BENNT";
//public static final String SELF_EMPLOY_SOCIAL_INSURANCE_VARIABLE_NAME = "SELF_EMPLOY_SOC_INSUR_CONTR_PER_HOUR";
public static final String HOURS_WORKED_WEEKLY = "HOURS_WORKED_WEEKLY";
public static final double MIN_CAPITAL_INCOME_PER_MONTH = 0.0;
public static final double MAX_CAPITAL_INCOME_PER_MONTH = 4000.0;
public static final double MIN_PERSONAL_PENSION_PER_MONTH = 0.0;
public static final double MAX_PERSONAL_PENSION_PER_MONTH = 15000.0;
private static String taxDonorInputFileName;
private static String populationInitialisationInputFileName;
private static MultiKeyMap<Object, Double> populationGrowthRatiosByRegionYear;
public static boolean saveImperfectTaxDBMatches = false;
public static final int IMPERFECT_THRESHOLD = 5999;
public static String eq5dConversionParameters = "lawrence";
/////////////////////////////////////////////////////////////////// INITIALISATION OF DATA STRUCTURES //////////////////////////////////
public static Map<Integer, String> EUROMODpolicySchedule = new TreeMap<Integer, String>();
public static Map<Integer, Pair<String, Integer>> EUROMODpolicyScheduleSystemYearMap = new TreeMap<>(); // This map stores year from which policy applies, and then a Pair of <name of policy, policy system year as specified in EM>. This is used when uprating values from the policy system year to a current simulated year.
private static MultiKeyMap<Object, Double> fertilityRateByRegionYear;
private static Map<Integer, Double> fertilityRateByYear;
private static MultiKeyCoefficientMap populationProjections;
public static final int ALIGN_MIN_AGE_ASSUME_DEATH = 65;
public static final int ALIGN_MAX_AGE_REQUIRE_MATCH = 65;
private static int populationProjectionsMaxYear;
private static int populationProjectionsMinYear;
private static int populationProjectionsMaxAge;
private static MultiKeyCoefficientMap benefitUnitVariableNames;
//RMSE for linear regressions
private static MultiKeyCoefficientMap coefficientMapRMSE;
//Uprating factor
private static boolean flagDefaultToTimeSeriesAverages;
private static Double averageSavingReturns, averageDebtCostLow, averageDebtCostHigh;
private static MultiKeyCoefficientMap upratingIndexMapRealGDP, upratingIndexMapInflation, socialCareProvisionTimeAdjustment,
partnershipTimeAdjustment, fertilityTimeAdjustment, utilityTimeAdjustmentSingleMales, utilityTimeAdjustmentSingleFemales,
utilityTimeAdjustmentCouples, upratingIndexMapRealWageGrowth, priceMapRealSavingReturns, priceMapRealDebtCostLow, priceMapRealDebtCostHigh,
wageRateFormalSocialCare, socialCarePolicy, partneredShare, employedShareSingleMales, employedShareSingleFemales, employedShareCouples;
public static Map<Integer, Double> partnershipAlignAdjustment, fertilityAlignAdjustment;
public static MultiKeyMap upratingFactorsMap = new MultiKeyMap<>();
//Education level projections
private static MultiKeyCoefficientMap projectionsHighEdu; //Alignment projections for High Education
private static MultiKeyCoefficientMap projectionsLowEdu; //Alignment projections for Medium Education
//Student share projections for alignment
private static MultiKeyCoefficientMap studentShareProjections; //Alignment projections for Student share of population
//Employment alignment targets
private static MultiKeyCoefficientMap employmentAlignment;
//For marriage types:
private static MultiKeyCoefficientMap marriageTypesFrequency;
private static Map<Gender, MultiKeyMap<Region, Double>> marriageTypesFrequencyByGenderAndRegion;
//Mean and covariances for parametric matching
private static MultiKeyCoefficientMap meanCovarianceParametricMatching;
private static MultiKeyCoefficientMap fixedRetireAge;
// private static MultiKeyCoefficientMap rawProbSick;
private static MultiKeyCoefficientMap unemploymentRates;
// private static MultiKeyMap probSick;
//MultivariateNormalDistribution of age and potential earnings differential to use in the parametric partnership process
public final static boolean MARRIAGE_MATCH_TO_MEANS = false;
public static double targetMeanWageDifferential, targetMeanAgeDifferential;
private static MultivariateNormalDistribution wageAndAgeDifferentialMultivariateNormalDistribution;
//Mortality, fertility, and unemployment tables for the intertemporal optimisation model
private static MultiKeyCoefficientMap mortalityProbabilityByGenderAgeYear; //Load as MultiKeyCoefficientMap as all values are in the Excel file and just need to be accessible
private static int mortalityProbabilityMaxYear;
private static int mortalityProbabilityMinYear;
private static int mortalityProbabilityMaxAge;
private static MultiKeyCoefficientMap fertilityProjectionsByYear; //NB: these currently only go up to 2043
public static int fertilityProjectionsMaxYear;
public static int fertilityProjectionsMinYear;
private static MultiKeyCoefficientMap unemploymentRatesMaleGraduatesByAgeYear; //Load as MultiKeyCoefficientMap as all values are in the Excel file and just need to be accessible
private static int unemploymentRatesMaleGraduatesMaxYear;
private static int unemploymentRatesMaleGraduatesMinYear;
private static int unemploymentRatesMaleGraduatesMaxAge;
private static MultiKeyCoefficientMap unemploymentRatesMaleNonGraduatesByAgeYear; //Load as MultiKeyCoefficientMap as all values are in the Excel file and just need to be accessible
private static int unemploymentRatesMaleNonGraduatesMaxYear;
private static int unemploymentRatesMaleNonGraduatesMinYear;
private static int unemploymentRatesMaleNonGraduatesMaxAge;
private static MultiKeyCoefficientMap unemploymentRatesFemaleGraduatesByAgeYear; //Load as MultiKeyCoefficientMap as all values are in the Excel file and just need to be accessible
private static int unemploymentRatesFemaleGraduatesMaxYear;
private static int unemploymentRatesFemaleGraduatesMinYear;
private static int unemploymentRatesFemaleGraduatesMaxAge;
private static MultiKeyCoefficientMap unemploymentRatesFemaleNonGraduatesByAgeYear; //Load as MultiKeyCoefficientMap as all values are in the Excel file and just need to be accessible
private static int unemploymentRatesFemaleNonGraduatesMaxYear;
private static int unemploymentRatesFemaleNonGraduatesMinYear;
private static int unemploymentRatesFemaleNonGraduatesMaxAge;
//Number of employments on full and flexible furlough from HMRC statistics, used as regressors in the Covid-19 module
private static MultiKeyCoefficientMap employmentsFurloughedFull;
private static MultiKeyCoefficientMap employmentsFurloughedFlex;
/////////////////////////////////////////////////////////////////// REGRESSION COEFFICIENTS //////////////////////////////////////////
//Health
private static MultiKeyCoefficientMap coeffCovarianceHealthH1a;
private static MultiKeyCoefficientMap coeffCovarianceHealthH1b;
private static MultiKeyCoefficientMap coeffCovarianceHealthH2b; //Prob. long-term sick or disabled
//Social care
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS1a; // prob of needing social care under 65
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS1b;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS2a; // prob of needing social care 65+
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS2b;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS2c;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS2d;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS2e;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS2f;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS2g;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS2h;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS2i;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS2j;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS2k;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS3a;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS3b;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS3c;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS3d;
private static MultiKeyCoefficientMap coeffCovarianceSocialCareS3e;
//Unemployment
private static MultiKeyCoefficientMap coeffCovarianceUnemploymentU1a;
private static MultiKeyCoefficientMap coeffCovarianceUnemploymentU1b;
private static MultiKeyCoefficientMap coeffCovarianceUnemploymentU1c;
private static MultiKeyCoefficientMap coeffCovarianceUnemploymentU1d;
//Mental health
private static MultiKeyCoefficientMap coeffCovarianceHM1Level; //Step 1 coefficients for mental health
private static MultiKeyCoefficientMap coeffCovarianceHM2LevelMales; //Step 2 coefficients for mental health for males
private static MultiKeyCoefficientMap coeffCovarianceHM2LevelFemales;
private static MultiKeyCoefficientMap coeffCovarianceHM1Case;
private static MultiKeyCoefficientMap coeffCovarianceHM2CaseMales;
private static MultiKeyCoefficientMap coeffCovarianceHM2CaseFemales;
//Health
private static MultiKeyCoefficientMap coeffCovarianceDHE_MCS1;
private static MultiKeyCoefficientMap coeffCovarianceDHE_MCS2Males;
private static MultiKeyCoefficientMap coeffCovarianceDHE_MCS2Females;
private static MultiKeyCoefficientMap coeffCovarianceDHE_PCS1;
private static MultiKeyCoefficientMap coeffCovarianceDHE_PCS2Males;
private static MultiKeyCoefficientMap coeffCovarianceDHE_PCS2Females;
private static MultiKeyCoefficientMap coeffCovarianceDLS1;
private static MultiKeyCoefficientMap coeffCovarianceDLS2Males;
private static MultiKeyCoefficientMap coeffCovarianceDLS2Females;
private static MultiKeyCoefficientMap coeffCovarianceEQ5D;
//Education
private static MultiKeyCoefficientMap coeffCovarianceEducationE1a;
private static MultiKeyCoefficientMap coeffCovarianceEducationE1b;
private static MultiKeyCoefficientMap coeffCovarianceEducationE2a;
//Partnership
private static MultiKeyCoefficientMap coeffCovariancePartnershipU1a; //Probit enter partnership if in continuous education
private static MultiKeyCoefficientMap coeffCovariancePartnershipU1b; //Probit enter partnership if not in continuous education
private static MultiKeyCoefficientMap coeffCovariancePartnershipU2b; //Probit exit partnership (females)
//Partnership for Italy
private static MultiKeyCoefficientMap coeffCovariancePartnershipITU1; //Probit enter partnership for Italy
private static MultiKeyCoefficientMap coeffCovariancePartnershipITU2; //Probit exit partnership for Italy
//Fertility
private static MultiKeyCoefficientMap coeffCovarianceFertilityF1a; //Probit fertility if in continuous education
private static MultiKeyCoefficientMap coeffCovarianceFertilityF1b; //Probit fertility if not in continuous education
//Fertility for Italy
private static MultiKeyCoefficientMap coeffCovarianceFertilityF1; //Probit fertility for Italy
//Income
private static MultiKeyCoefficientMap coeffCovarianceIncomeI1a; //Linear regression non-employment non-benefit income if in continuous education
private static MultiKeyCoefficientMap coeffCovarianceIncomeI1b; //Linear regression non-employment non-benefit income if not in continuous education
private static MultiKeyCoefficientMap coeffCovarianceIncomeI3a; //Capital income if in continuous education
private static MultiKeyCoefficientMap coeffCovarianceIncomeI3b; //Capital income if not in continuous education
private static MultiKeyCoefficientMap coeffCovarianceIncomeI3c; //Pension income for those aged over 50 who are not in continuous education
private static MultiKeyCoefficientMap coeffCovarianceIncomeI4a, coeffCovarianceIncomeI4b; // Pension income for those moving from employment to retirement (I4a) and those already retired (I4b)
private static MultiKeyCoefficientMap coeffCovarianceIncomeI5a_selection, coeffCovarianceIncomeI5b_amount; // Selection equation for receiving pension income for those moving from employment to retirement (I5a) and amount in levels (I5b)
private static MultiKeyCoefficientMap coeffCovarianceIncomeI6a_selection, coeffCovarianceIncomeI6b_amount; // Selection equation for receiving pension income for those in retirement (I6a) and amount in levels (I6b), in the initial simulated year
private static MultiKeyCoefficientMap coeffCovarianceIncomeI3a_selection; //Probability of receiving capital income if in continuous education
private static MultiKeyCoefficientMap coeffCovarianceIncomeI3b_selection; //Probability of receiving capital income if not in continuous education
//Homeownership
private static MultiKeyCoefficientMap coeffCovarianceHomeownership; //Probit regression assigning homeownership status
//Wages
private static MultiKeyCoefficientMap coeffCovarianceWagesMales, coeffCovarianceWagesMalesNE, coeffCovarianceWagesMalesE;
private static MultiKeyCoefficientMap coeffCovarianceWagesFemales, coeffCovarianceWagesFemalesNE, coeffCovarianceWagesFemalesE;
//Labour Market
private static MultiKeyCoefficientMap coeffCovarianceEmploymentSelectionMales, coeffCovarianceEmploymentSelectionMalesNE, coeffCovarianceEmploymentSelectionMalesE;
private static MultiKeyCoefficientMap coeffCovarianceEmploymentSelectionFemales, coeffCovarianceEmploymentSelectionFemalesNE, coeffCovarianceEmploymentSelectionFemalesE;
private static MultiKeyCoefficientMap coeffLabourSupplyUtilityMales;
private static MultiKeyCoefficientMap coeffLabourSupplyUtilityFemales;
private static MultiKeyCoefficientMap coeffLabourSupplyUtilityMalesWithDependent; //For use with couples where only male is flexible in labour supply (so has a dependent)
private static MultiKeyCoefficientMap coeffLabourSupplyUtilityFemalesWithDependent;
private static MultiKeyCoefficientMap coeffLabourSupplyUtilityACMales; //Adult children, male
private static MultiKeyCoefficientMap coeffLabourSupplyUtilityACFemales; //Adult children, female
private static MultiKeyCoefficientMap coeffLabourSupplyUtilityCouples;
// coefficients for Covid-19 labour supply models below
// Initialisation
private static MultiKeyCoefficientMap coeffCovarianceC19LS_SE;
// Transitions
// From lagged state "employed"
private static MultiKeyCoefficientMap coeffC19LS_E1_NE; // For multi probit regressions, have to specify coefficients for each possible outcome, with "no changes" being the baseline. NE is not-employed.
private static MultiKeyCoefficientMap coeffC19LS_E1_SE; // self-employed
private static MultiKeyCoefficientMap coeffC19LS_E1_FF; // furloughed full
private static MultiKeyCoefficientMap coeffC19LS_E1_FX; // furloughed flex
private static MultiKeyCoefficientMap coeffC19LS_E1_SC; // some changes
// From lagged state "furloughed full"
private static MultiKeyCoefficientMap coeffC19LS_FF1_E; // employed
private static MultiKeyCoefficientMap coeffC19LS_FF1_FX; // furloughed flex
private static MultiKeyCoefficientMap coeffC19LS_FF1_NE; // not-employed
private static MultiKeyCoefficientMap coeffC19LS_FF1_SE; // self-employed
// From lagged state "furloughed flex"
private static MultiKeyCoefficientMap coeffC19LS_FX1_E; // employed
private static MultiKeyCoefficientMap coeffC19LS_FX1_FF; // furloughed flex
private static MultiKeyCoefficientMap coeffC19LS_FX1_NE; // not-employed
private static MultiKeyCoefficientMap coeffC19LS_FX1_SE; // self-employed
// From lagged state "self-employed"
private static MultiKeyCoefficientMap coeffC19LS_S1_E; // employed
private static MultiKeyCoefficientMap coeffC19LS_S1_NE; // not-employed
// From lagged state "not-employed"
private static MultiKeyCoefficientMap coeffC19LS_U1_E; // employed
private static MultiKeyCoefficientMap coeffC19LS_U1_SE; // self-employed
// Define maps that the above coefficients are bundled into
private static Map<Les_transitions_E1, MultiKeyCoefficientMap> coeffC19LS_E1Map;
private static Map<Les_transitions_FF1, MultiKeyCoefficientMap> coeffC19LS_FF1Map;
private static Map<Les_transitions_FX1, MultiKeyCoefficientMap> coeffC19LS_FX1Map;
private static Map<Les_transitions_S1, MultiKeyCoefficientMap> coeffC19LS_S1Map;
private static Map<Les_transitions_U1, MultiKeyCoefficientMap> coeffC19LS_U1Map;
// Hours of work
private static MultiKeyCoefficientMap coeffC19LS_E2a;
private static MultiKeyCoefficientMap coeffC19LS_E2b;
private static MultiKeyCoefficientMap coeffC19LS_F2a;
private static MultiKeyCoefficientMap coeffC19LS_F2b;
private static MultiKeyCoefficientMap coeffC19LS_F2c;
private static MultiKeyCoefficientMap coeffC19LS_S2a;
private static MultiKeyCoefficientMap coeffC19LS_U2a;
// Probability of receiving SEISS
private static MultiKeyCoefficientMap coeffC19LS_S3;
//Leaving parental home
private static MultiKeyCoefficientMap coeffCovarianceLeaveHomeP1a;
//Retirement
private static MultiKeyCoefficientMap coeffCovarianceRetirementR1a;
private static MultiKeyCoefficientMap coeffCovarianceRetirementR1b;
//Childcare
public static final int MAX_CHILD_AGE_FOR_FORMAL_CARE = 14;
private static MultiKeyCoefficientMap coeffCovarianceChildcareC1a;
private static MultiKeyCoefficientMap coeffCovarianceChildcareC1b;
///////////////////////////////////////////////////////////STATISTICS FOR VALIDATION/////////////////////////////////////////////
//Share of students by age
private static MultiKeyCoefficientMap validationStudentsByAge;
//Share of students by region
private static MultiKeyCoefficientMap validationStudentsByRegion;
//Education level of over 17 year olds
private static MultiKeyCoefficientMap validationEducationLevel;
//Education level by age group
private static MultiKeyCoefficientMap validationEducationLevelByAge;
//Education level by region
private static MultiKeyCoefficientMap validationEducationLevelByRegion;
//Share of couple by region
private static MultiKeyCoefficientMap validationPartneredShareByRegion;
//Share of disabled by age
private static MultiKeyCoefficientMap validationDisabledByAge;
private static MultiKeyCoefficientMap validationDisabledByGender;
//Health by age
private static MultiKeyCoefficientMap validationHealthByAge;
//Mental health by age and gender
private static MultiKeyCoefficientMap validationMentalHealthByAge;
//Psychological distress cases by age and gender
private static MultiKeyCoefficientMap validationPsychDistressByAge, validationPsychDistressByAgeLow, validationPsychDistressByAgeMed, validationPsychDistressByAgeHigh;
// Health
private static MultiKeyCoefficientMap validationHealthMCSByAge, validationHealthPCSByAge;
// Life Satisfaction
private static MultiKeyCoefficientMap validationLifeSatisfactionByAge;
//Employment by gender
private static MultiKeyCoefficientMap validationEmploymentByGender;
//Employment by gender and age
private static MultiKeyCoefficientMap validationEmploymentByAgeAndGender;
//Employment by maternity
private static MultiKeyCoefficientMap validationEmploymentByMaternity;
//Employment by gender and region
private static MultiKeyCoefficientMap validationEmploymentByGenderAndRegion;
private static MultiKeyCoefficientMap validationLabourSupplyByEducation;
//Activity status
private static MultiKeyCoefficientMap validationActivityStatus;
//Homeownership status for benefit units
private static MultiKeyCoefficientMap validationHomeownershipBenefitUnits;
//Gross earnings yearly by education and gender (for employed persons)
private static MultiKeyCoefficientMap validationGrossEarningsByGenderAndEducation;
//Hourly wages by education and gender (for employed persons)
private static MultiKeyCoefficientMap validationLhwByGenderAndEducation;
//Hours worked weekly by education and gender (for employed persons)
private static MultiKeyCoefficientMap hourlyWageByGenderAndEducation;
/////////////////////////////////////////////////////////////////// REGRESSION OBJECTS //////////////////////////////////////////
//Health
private static OrderedRegression regHealthH1a;
private static OrderedRegression regHealthH1b;
private static BinomialRegression regHealthH2b;
//Social care
private static BinomialRegression regReceiveCareS1a;
private static LinearRegression regCareHoursS1b;
private static BinomialRegression regNeedCareS2a;
private static BinomialRegression regReceiveCareS2b;
private static MultinomialRegression regSocialCareMarketS2c;
private static BinomialRegression regReceiveCarePartnerS2d;
private static MultinomialRegression regPartnerSupplementaryCareS2e;
private static MultinomialRegression regNotPartnerInformalCareS2f;
private static LinearRegression regPartnerCareHoursS2g;
private static LinearRegression regDaughterCareHoursS2h;
private static LinearRegression regSonCareHoursS2i;
private static LinearRegression regOtherCareHoursS2j;
private static LinearRegression regFormalCareHoursS2k;
private static BinomialRegression regCarePartnerProvCareToOtherS3a;
private static BinomialRegression regNoCarePartnerProvCareToOtherS3b;
private static BinomialRegression regNoPartnerProvCareToOtherS3c;
private static MultinomialRegression regInformalCareToS3d;
private static LinearRegression regCareHoursProvS3e;
//Unemployment
private static BinomialRegression regUnemploymentMaleGraduateU1a;
private static BinomialRegression regUnemploymentMaleNonGraduateU1b;
private static BinomialRegression regUnemploymentFemaleGraduateU1c;
private static BinomialRegression regUnemploymentFemaleNonGraduateU1d;
//Health mental
private static LinearRegression regHealthHM1Level;
private static LinearRegression regHealthHM2LevelMales;
private static LinearRegression regHealthHM2LevelFemales;
private static BinomialRegression regHealthHM1Case;
private static BinomialRegression regHealthHM2CaseMales;
private static BinomialRegression regHealthHM2CaseFemales;
//Health
private static LinearRegression regHealthMCS1;
private static LinearRegression regHealthMCS2Males;
private static LinearRegression regHealthMCS2Females;
private static LinearRegression regHealthPCS1;
private static LinearRegression regHealthPCS2Males;
private static LinearRegression regHealthPCS2Females;
private static LinearRegression regLifeSatisfaction1;
private static LinearRegression regLifeSatisfaction2Males;
private static LinearRegression regLifeSatisfaction2Females;
private static LinearRegression regHealthEQ5D;
//Education
private static BinomialRegression regEducationE1a;
private static BinomialRegression regEducationE1b;
private static OrderedRegression regEducationE2a;
//Partnership
private static BinomialRegression regPartnershipU1a;
private static BinomialRegression regPartnershipU1b;
private static BinomialRegression regPartnershipU2b;
private static BinomialRegression regPartnershipITU1;
private static BinomialRegression regPartnershipITU2;
//Fertility
private static BinomialRegression regFertilityF1a;
private static BinomialRegression regFertilityF1b;
private static BinomialRegression regFertilityF1;
//Income
private static LinearRegression regIncomeI1a;
private static LinearRegression regIncomeI1b;
private static LinearRegression regIncomeI3a;
private static LinearRegression regIncomeI3b;
private static LinearRegression regIncomeI3c;
private static LinearRegression regIncomeI4a;
private static LinearRegression regIncomeI4b;
private static LinearRegression regIncomeI5b_amount;
private static LinearRegression regIncomeI6b_amount;
private static BinomialRegression regIncomeI3a_selection;
private static BinomialRegression regIncomeI3b_selection;
private static BinomialRegression regIncomeI5a_selection;
private static BinomialRegression regIncomeI6a_selection;
//Homeownership
private static BinomialRegression regHomeownershipHO1a;
private static MultinomialRegression<Education> regEducationLevel;
//New simple educ level
private static MultinomialRegression<Education> regSimpleEducLevel;
//For Labour market
private static LinearRegression regWagesMales;
private static LinearRegression regWagesMalesE;
private static LinearRegression regWagesMalesNE;
private static LinearRegression regWagesFemales, regWagesFemalesE, regWagesFemalesNE;
private static LinearRegression regEmploymentSelectionMale, regEmploymentSelectionMaleE, regEmploymentSelectionMaleNE; //To calculate Inverse Mills Ratio for Heckman Two-Step Procedure
private static LinearRegression regEmploymentSelectionFemale, regEmploymentSelectionFemaleE, regEmploymentSelectionFemaleNE; //To calculate Inverse Mills Ratio for Heckman Two-Step Procedure
private static NormalDistribution standardNormalDistribution; //To sample the inverse mills ratio
private static LinearRegression regLabourSupplyUtilityMales;
private static LinearRegression regLabourSupplyUtilityFemales;
private static LinearRegression regLabourSupplyUtilityMalesWithDependent;
private static LinearRegression regLabourSupplyUtilityFemalesWithDependent;
private static LinearRegression regLabourSupplyUtilityACMales;
private static LinearRegression regLabourSupplyUtilityACFemales;
private static LinearRegression regLabourSupplyUtilityCouples;
// Covid-19 labour transitions regressions below
// Initialisation
private static BinomialRegression regC19LS_SE; // Assigns self-employed status in the simulated population
// Transitions
private static MultinomialRegression<Les_transitions_E1> regC19LS_E1; // Models transitions from employment
private static MultinomialRegression<Les_transitions_FF1> regC19LS_FF1; // Models transitions from furlough full
private static MultinomialRegression<Les_transitions_FX1> regC19LS_FX1; // Models transitions from furlough flex
private static MultinomialRegression<Les_transitions_S1> regC19LS_S1; // Models transitions from self-employment
private static MultinomialRegression<Les_transitions_U1> regC19LS_U1; // Models transitions from non-employment
// Hours of work
private static LinearRegression regC19LS_E2a;
private static LinearRegression regC19LS_E2b;
private static LinearRegression regC19LS_F2a;
private static LinearRegression regC19LS_F2b;
private static LinearRegression regC19LS_F2c;
private static LinearRegression regC19LS_S2a;
private static LinearRegression regC19LS_U2a;
// Probability of SEISS
private static BinomialRegression regC19LS_S3;
//Leaving parental home
private static BinomialRegression regLeaveHomeP1a;
//Retirement
private static BinomialRegression regRetirementR1a;
private static BinomialRegression regRetirementR1b;
//Childcare
private static BinomialRegression regChildcareC1a;
private static LinearRegression regChildcareC1b;
private static BinomialRegression regBirthFemales;
private static BinomialRegression regUnionFemales;
private static Set<Region> countryRegions;
private static Map<Region, Double> unemploymentRatesByRegion;
public static boolean isFixTimeTrend;
public static Integer timeTrendStopsIn;
public static boolean flagFormalChildcare;
public static boolean flagSocialCare;
public static boolean flagSuppressChildcareCosts;
public static boolean flagSuppressSocialCareCosts;
public static boolean donorPoolAveraging;
public static double realInterestRateInnov;
public static double disposableIncomeFromLabourInnov;
/**
*
* METHOD TO LOAD PARAMETERS FOR GIVEN COUNTRY
* @param country
*
*/
public static void loadParameters(Country country, int maxAgeModel, boolean enableIntertemporalOptimisations,
boolean projectFormalChildcare, boolean projectSocialCare, boolean donorPoolAveraging1,
boolean fixTimeTrend, boolean defaultToTimeSeriesAverages, boolean taxDBMatches,
Integer timeTrendStops, int startYearModel, int endYearModel, double interestRateInnov1,
double disposableIncomeFromLabourInnov1, boolean flagSuppressChildcareCosts1,
boolean flagSuppressSocialCareCosts1) {
// display a dialog box to let the user know what is happening
System.out.println("Loading model parameters");
System.out.flush();
maxAge = maxAgeModel;
startYear = startYearModel;
endYear = endYearModel;
EUROMODpolicySchedule = calculateEUROMODpolicySchedule(country);
taxDonorInputFileName = "population_" + country;
populationInitialisationInputFileName = "population_initial_" + country;
setCountryRegions(country);
setEnableIntertemporalOptimisations(enableIntertemporalOptimisations);
setProjectLiquidWealth();
String countryString = country.toString();
loadTimeSeriesFactorMaps(country);
instantiateAlignmentMaps();
// scenario parameters
if (country.equals(Country.IT)) {
SAVINGS_RATE = 0.056;
} else {
SAVINGS_RATE = 0.056;
}
saveImperfectTaxDBMatches = taxDBMatches;
flagDefaultToTimeSeriesAverages = defaultToTimeSeriesAverages;
isFixTimeTrend = fixTimeTrend;
timeTrendStopsIn = timeTrendStops;
flagFormalChildcare = projectFormalChildcare;
flagSocialCare = projectSocialCare;
flagSuppressChildcareCosts = flagSuppressChildcareCosts1;
flagSuppressSocialCareCosts = flagSuppressSocialCareCosts1;
donorPoolAveraging = donorPoolAveraging1;
realInterestRateInnov = interestRateInnov1;
disposableIncomeFromLabourInnov = disposableIncomeFromLabourInnov1;
// unemploymentRatesByRegion = new LinkedHashMap<>();
// unemploymentRates = ExcelAssistant.loadCoefficientMap("input/scenario_unemploymentRates.xlsx", countryString, 1, 46);
fixedRetireAge = ExcelAssistant.loadCoefficientMap("input/scenario_retirementAgeFixed.xlsx", countryString, 1, 2);
/*
rawProbSick = ExcelAssistant.loadCoefficientMap("input/scenario_probSick.xls", country.toString(), 2, 1);
for (Object o: rawProbSick.keySet()) {
MultiKey mk = (MultiKey)o;
int age = ((Number)mk.getKey(1)).intValue();
if (((String)mk.getKey(0)).equals(Gender.Female.toString())) {
if (age > femaleMaxAgeSick) {
femaleMaxAgeSick = age;
// } else if(age < femaleMinAgeSick) {
// femaleMinAgeSick = age;
}
} else {
// gender in multikey must be male
if (age > maleMaxAgeSick) {
maleMaxAgeSick = age;
// } else if(age < maleMinAgeSick) {
// maleMinAgeSick = age;
}
}
}
probSick = new MultiKeyMap();
*/
// alignment parameters
populationProjections = ExcelAssistant.loadCoefficientMap("input/align_popProjections.xlsx", countryString, 3, 110);
setMapBounds(MapBounds.Population, countryString);
//Alignment of education levels
projectionsHighEdu = ExcelAssistant.loadCoefficientMap("input/align_educLevel.xlsx", countryString + "_High", 1, 2);
projectionsLowEdu = ExcelAssistant.loadCoefficientMap("input/align_educLevel.xlsx", countryString + "_Low", 1, 2);
studentShareProjections = ExcelAssistant.loadCoefficientMap("input/align_student_under30.xlsx", countryString, 1, 40);
//Employment alignment
employmentAlignment = ExcelAssistant.loadCoefficientMap("input/align_employment.xlsx", countryString, 2, 40);
//Marriage types frequencies:
marriageTypesFrequency = ExcelAssistant.loadCoefficientMap("input/marriageTypes2.xlsx", countryString, 2, 1);
marriageTypesFrequencyByGenderAndRegion = new LinkedHashMap<Gender, MultiKeyMap<Region, Double>>(); //Create a map of maps to store the frequencies
//Mortality rates
mortalityProbabilityByGenderAgeYear = ExcelAssistant.loadCoefficientMap("input/projections_mortality.xlsx", countryString + "_MortalityByGenderAgeYear", 2, 120);
setMapBounds(MapBounds.Mortality, countryString);
//Fertility rates:
fertilityProjectionsByYear = ExcelAssistant.loadCoefficientMap("input/projections_fertility.xlsx", countryString + "_FertilityByYear", 1, 71);
setMapBounds(MapBounds.Fertility, countryString);
//Unemployment rates
unemploymentRatesMaleGraduatesByAgeYear = ExcelAssistant.loadCoefficientMap("input/reg_unemployment.xlsx", countryString + "_RatesMaleGraduates", 1, 49);
setMapBounds(MapBounds.UnemploymentMaleGraduates, countryString);
unemploymentRatesMaleNonGraduatesByAgeYear = ExcelAssistant.loadCoefficientMap("input/reg_unemployment.xlsx", countryString + "_RatesMaleNonGraduates", 1, 49);
setMapBounds(MapBounds.UnemploymentMaleNonGraduates, countryString);
unemploymentRatesFemaleGraduatesByAgeYear = ExcelAssistant.loadCoefficientMap("input/reg_unemployment.xlsx", countryString + "_RatesFemaleGraduates", 1, 49);
setMapBounds(MapBounds.UnemploymentFemaleGraduates, countryString);
unemploymentRatesFemaleNonGraduatesByAgeYear = ExcelAssistant.loadCoefficientMap("input/reg_unemployment.xlsx", countryString + "_RatesFemaleNonGraduates", 1, 49);
setMapBounds(MapBounds.UnemploymentFemaleNonGraduates, countryString);
//RMSE
coefficientMapRMSE = ExcelAssistant.loadCoefficientMap("input/reg_RMSE.xlsx", countryString, 1, 1);
//Employments on furlough
employmentsFurloughedFull = ExcelAssistant.loadCoefficientMap("input/scenario_employments_furloughed.xlsx", countryString + "_FullFurlough", 2, 1);
employmentsFurloughedFlex = ExcelAssistant.loadCoefficientMap("input/scenario_employments_furloughed.xlsx", countryString + "_FlexibleFurlough", 2, 1);
//Load country specific data
int columnsWagesMales = -1;
int columnsWagesMalesNE = -1;
int columnsWagesMalesE = -1;
int columnsWagesFemales = -1;
int columnsWagesFemalesNE = -1;
int columnsWagesFemalesE = -1;
int columnsEmploymentSelectionMales = -1;
int columnsEmploymentSelectionMalesNE = -1;
int columnsEmploymentSelectionMalesE = -1;
int columnsEmploymentSelectionFemales = -1;
int columnsEmploymentSelectionFemalesNE = -1;
int columnsEmploymentSelectionFemalesE = -1;
int columnsLabourSupplyUtilityMales = -1;
int columnsLabourSupplyUtilityFemales = -1;
int columnsLabourSupplyUtilityMalesWithDependent = -1;
int columnsLabourSupplyUtilityFemalesWithDependent = -1;
int columnsLabourSupplyUtilityACMales = -1;
int columnsLabourSupplyUtilityACFemales = -1;
int columnsLabourSupplyUtilityCouples = -1;
int columnsLabourCovid19_SE = -1;
int columnsLabourCovid19_2a_processes = -1;
int columnsHealthH1a = -1;
int columnsHealthH1b = -1;
int columnsHealthH2b = -1;
int columnsHealthHM1 = -1;
int columnsHealthHM2Males = -1;
int columnsHealthHM2Females = -1;
int columnsHealthMCS1 = -1;
int columnsHealthMCS2Males = -1;
int columnsHealthMCS2Females = -1;
int columnsHealthPCS1 = -1;
int columnsHealthPCS2Males = -1;
int columnsHealthPCS2Females = -1;
int columnsLifeSatisfaction1 = -1;
int columnsLifeSatisfaction2Males = -1;
int columnsLifeSatisfaction2Females = -1;
int columnsHealthEQ5D = -1;
int columnsSocialCareS1a = -1;
int columnsSocialCareS1b = -1;
int columnsSocialCareS2a = -1;
int columnsSocialCareS2b = -1;
int columnsSocialCareS2c = -1;
int columnsSocialCareS2d = -1;
int columnsSocialCareS2e = -1;
int columnsSocialCareS2f = -1;
int columnsSocialCareS2g = -1;
int columnsSocialCareS2h = -1;
int columnsSocialCareS2i = -1;
int columnsSocialCareS2j = -1;
int columnsSocialCareS2k = -1;
int columnsSocialCareS3a = -1;
int columnsSocialCareS3b = -1;
int columnsSocialCareS3c = -1;
int columnsSocialCareS3d = -1;
int columnsSocialCareS3e = -1;
int columnsUnemploymentU1a = -1;
int columnsUnemploymentU1b = -1;