diff --git a/config/default.yml b/config/default.yml index 5e8daf241..cb92b77f3 100644 --- a/config/default.yml +++ b/config/default.yml @@ -6,7 +6,7 @@ executeWithGui: false randomSeed: 606 startYear: 2019 endYear: 2026 -popSize: 170000 +popSize: 50000 # Arguments passed to the SimPathsModel model_args: diff --git a/input/DatabaseCountryYear.xlsx b/input/DatabaseCountryYear.xlsx index 0c791de8a..162612274 100644 Binary files a/input/DatabaseCountryYear.xlsx and b/input/DatabaseCountryYear.xlsx differ diff --git a/input/EUROMODoutput/DatabaseCountryYear.xlsx b/input/EUROMODoutput/DatabaseCountryYear.xlsx new file mode 100644 index 000000000..f6173d4ad Binary files /dev/null and b/input/EUROMODoutput/DatabaseCountryYear.xlsx differ diff --git a/input/EUROMODoutput/EUROMODpolicySchedule.xlsx b/input/EUROMODoutput/EUROMODpolicySchedule.xlsx new file mode 100644 index 000000000..72ca67946 Binary files /dev/null and b/input/EUROMODoutput/EUROMODpolicySchedule.xlsx differ diff --git a/input/EUROMODpolicySchedule.xlsx b/input/EUROMODpolicySchedule.xlsx index ce8925d5b..ab9a6c0fa 100644 Binary files a/input/EUROMODpolicySchedule.xlsx and b/input/EUROMODpolicySchedule.xlsx differ diff --git a/input/reg_RMSE.xlsx b/input/reg_RMSE.xlsx index 8d9d984a4..2ad30ac0e 100644 Binary files a/input/reg_RMSE.xlsx and b/input/reg_RMSE.xlsx differ diff --git a/input/reg_education.xlsx b/input/reg_education.xlsx index c4c96c2c4..d009d987e 100644 Binary files a/input/reg_education.xlsx and b/input/reg_education.xlsx differ diff --git a/input/reg_employmentSelection.xlsx b/input/reg_employmentSelection.xlsx index e3734b6ac..459e89631 100644 Binary files a/input/reg_employmentSelection.xlsx and b/input/reg_employmentSelection.xlsx differ diff --git a/input/reg_fertility.xlsx b/input/reg_fertility.xlsx index f9dac777c..27644860a 100644 Binary files a/input/reg_fertility.xlsx and b/input/reg_fertility.xlsx differ diff --git a/input/reg_health.xlsx b/input/reg_health.xlsx index 74994f26e..06154b9a8 100644 Binary files a/input/reg_health.xlsx and b/input/reg_health.xlsx differ diff --git a/input/reg_home_ownership.xlsx b/input/reg_home_ownership.xlsx index 4803ba8a7..b272ac25a 100644 Binary files a/input/reg_home_ownership.xlsx and b/input/reg_home_ownership.xlsx differ diff --git a/input/reg_income.xlsx b/input/reg_income.xlsx index f10d898aa..69e85e35c 100644 Binary files a/input/reg_income.xlsx and b/input/reg_income.xlsx differ diff --git a/input/reg_leaveParentalHome.xlsx b/input/reg_leaveParentalHome.xlsx index bb8cc38f8..b41d9e2e9 100644 Binary files a/input/reg_leaveParentalHome.xlsx and b/input/reg_leaveParentalHome.xlsx differ diff --git a/input/reg_leave_parental_home.xlsx b/input/reg_leave_parental_home.xlsx new file mode 100644 index 000000000..2333c34cd Binary files /dev/null and b/input/reg_leave_parental_home.xlsx differ diff --git a/input/reg_partnership.xlsx b/input/reg_partnership.xlsx index 9c689b853..8fe633bdf 100644 Binary files a/input/reg_partnership.xlsx and b/input/reg_partnership.xlsx differ diff --git a/input/reg_retirement.xlsx b/input/reg_retirement.xlsx index 08663ae2b..22070f936 100644 Binary files a/input/reg_retirement.xlsx and b/input/reg_retirement.xlsx differ diff --git a/input/reg_wages.xlsx b/input/reg_wages.xlsx index 0fdacc128..492150b1e 100644 Binary files a/input/reg_wages.xlsx and b/input/reg_wages.xlsx differ diff --git a/input/scenario_parametricMatching.xlsx b/input/scenario_parametricMatching.xlsx index 70899584f..ec873c5ea 100644 Binary files a/input/scenario_parametricMatching.xlsx and b/input/scenario_parametricMatching.xlsx differ diff --git a/src/main/java/simpaths/data/ManagerRegressions.java b/src/main/java/simpaths/data/ManagerRegressions.java index b0ee9ee3e..143ab6568 100644 --- a/src/main/java/simpaths/data/ManagerRegressions.java +++ b/src/main/java/simpaths/data/ManagerRegressions.java @@ -196,15 +196,6 @@ public static OrderedRegression getOrderedRegression(RegressionName regression) throw new RuntimeException("requested ordered regression is not recognised: " + regression.name()); switch (regression) { - case HealthH1a -> { - return Parameters.getRegHealthH1a(); - } - case HealthH1b -> { - return Parameters.getRegHealthH1b(); - } - case EducationE2a -> { - return Parameters.getRegEducationE2a(); - } default -> { throw new RuntimeException("unrecognised regression (1)"); } @@ -217,6 +208,15 @@ public static GeneralisedOrderedRegression getGeneralisedOrderedRegression(Regre throw new RuntimeException("requested generalised ordered regression is not recognised: " + regression.name()); switch (regression) { + case HealthH1a -> { + return Parameters.getRegHealthH1a(); + } + case HealthH1b -> { + return Parameters.getRegHealthH1b(); + } + case EducationE2a -> { + return Parameters.getRegEducationE2a(); + } default -> { throw new RuntimeException("unrecognised regression (1)"); } diff --git a/src/main/java/simpaths/data/Parameters.java b/src/main/java/simpaths/data/Parameters.java index 2858f2f6e..ad6e81c2b 100644 --- a/src/main/java/simpaths/data/Parameters.java +++ b/src/main/java/simpaths/data/Parameters.java @@ -122,13 +122,16 @@ public class Parameters { "ded", //in education dummy "der", //return to education dummy "dot", //ethnicity + "dot01", //ethnicity 6 categories "dhe", //health status - "dhm", //mental health status + "dhe_mcs", //mental health - SF12 score MCS + "dhe_pcs", //physical health - SF12 score PCS + "dhe_mcssp", //mental health - SF12 score MCS (partner) + "dhe_pcssp", //physical health - SF12 score PCS (partner) + "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 "financial_distress", //financial distress "dcpyy", //years in partnership "dcpagdf", //partners age difference @@ -140,7 +143,7 @@ public class Parameters { "ypnoab", //gross personal pension (public / occupational) income "yplgrs_dv", //gross personal employment income "ynbcpdf_dv", //difference partner income - "dlltsd", //long-term sick or disabled + "dlltsd01", //long-term sick or disabled (we use this -and not dlltsd- in the DataParser) "sedex", //year left education "stm", //system variable - year "swv", //system variable - wave @@ -278,7 +281,7 @@ else if(numberOfChildren <= 5) { //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. + private static int MAX_START_YEAR = 2023; //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; @@ -298,7 +301,7 @@ else if(numberOfChildren <= 5) { public static final boolean systemOut = true; - //Bootstrap all the regression coefficients if true, or only the female labour participation regressions when false + //Bootstrap all the regression coefficients if true public static final boolean bootstrapAll = false; //Scheduling @@ -677,8 +680,8 @@ else if(numberOfChildren <= 5) { /////////////////////////////////////////////////////////////////// REGRESSION OBJECTS ////////////////////////////////////////// //Health - private static OrderedRegression regHealthH1a; - private static OrderedRegression regHealthH1b; + private static GeneralisedOrderedRegression regHealthH1a; + private static GeneralisedOrderedRegression regHealthH1b; private static BinomialRegression regHealthH2b; //Social care @@ -737,7 +740,7 @@ else if(numberOfChildren <= 5) { //Education private static BinomialRegression regEducationE1a; private static BinomialRegression regEducationE1b; - private static OrderedRegression regEducationE2a; + private static GeneralisedOrderedRegression regEducationE2a; //Partnership private static BinomialRegression regPartnershipU1a; @@ -1108,8 +1111,8 @@ public static void loadParameters(Country country, int maxAgeModel, boolean enab columnsIncomeI3b_selection = 22; columnsLeaveHomeP1a = 19; columnsHomeownership = 32; - columnsRetirementR1a = 19; - columnsRetirementR1b = 24; + columnsRetirementR1a = 33; + columnsRetirementR1b = 37; columnsChildcareC1a = 37; columnsChildcareC1b = 37; columnsValidationStudentsByAge = 10; @@ -1129,14 +1132,14 @@ public static void loadParameters(Country country, int maxAgeModel, boolean enab columnsValidationLabourSupplyByEducation = 3; } else if(country.equals(Country.UK)) { - columnsWagesMalesNE = 30; - columnsWagesMalesE = 31; - columnsWagesFemalesNE = 30; - columnsWagesFemalesE = 31; - columnsEmploymentSelectionMalesNE = 30; - columnsEmploymentSelectionMalesE = 29; - columnsEmploymentSelectionFemalesNE = 30; - columnsEmploymentSelectionFemalesE = 29; + columnsWagesMalesNE = 33; + columnsWagesMalesE = 34; + columnsWagesFemalesNE = 33; + columnsWagesFemalesE = 34; + columnsEmploymentSelectionMalesNE = 32; + columnsEmploymentSelectionMalesE = 32; + columnsEmploymentSelectionFemalesNE = 32; + columnsEmploymentSelectionFemalesE = 32; columnsLabourSupplyUtilityMales = 19; columnsLabourSupplyUtilityFemales = 12; columnsLabourSupplyUtilityMalesWithDependent = 23; @@ -1146,9 +1149,9 @@ else if(country.equals(Country.UK)) { columnsLabourSupplyUtilityCouples = 64; columnsLabourCovid19_SE = 1; columnsLabourCovid19_2a_processes = 1; - columnsHealthH1a = 28; - columnsHealthH1b = 35; - columnsHealthH2b = 35; + columnsHealthH1a = 31; + columnsHealthH1b = 110; + columnsHealthH2b = 36; columnsHealthHM1 = 30; columnsHealthHM2Males = 15; columnsHealthHM2Females = 15; @@ -1185,31 +1188,31 @@ else if(country.equals(Country.UK)) { columnsUnemploymentU1c = 19; columnsUnemploymentU1d = 19; columnsFinancialDistress = 50; - columnsEducationE1a = 19; - columnsEducationE1b = 25; - columnsEducationE2a = 11; - columnsPartnershipU1a = 27; - columnsPartnershipU1b = 31; + columnsEducationE1a = 24; + columnsEducationE1b = 29; + columnsEducationE2a = 24; + columnsPartnershipU1a = 16; + columnsPartnershipU1b = 29; columnsPartnershipU2b = 38; columnsFertilityF1a = 6; - columnsFertilityF1b = 26; + columnsFertilityF1b = 36; columnsIncomeI1a = 19; //* columnsIncomeI1b = 31; //* - columnsIncomeI3a = 20; - columnsIncomeI3b = 29; + columnsIncomeI3a = 26; + columnsIncomeI3b = 36; columnsIncomeI3c = 28; //* columnsIncomeI4a = 24; //* - columnsIncomeI4b = 25; - columnsIncomeI5a = 25; - columnsIncomeI5b = 25; + columnsIncomeI4b = 31; + columnsIncomeI5a = 30; + columnsIncomeI5b = 31; columnsIncomeI6a = 22; //* columnsIncomeI6b = 22; //* - columnsIncomeI3a_selection = 20; - columnsIncomeI3b_selection = 29; + columnsIncomeI3a_selection = 26; + columnsIncomeI3b_selection = 36; columnsLeaveHomeP1a = 25; - columnsHomeownership = 33; - columnsRetirementR1a = 26; - columnsRetirementR1b = 31; + columnsHomeownership = 41; + columnsRetirementR1a = 33; + columnsRetirementR1b = 37; columnsChildcareC1a = 37; columnsChildcareC1b = 37; columnsValidationStudentsByAge = 10; @@ -1408,7 +1411,7 @@ else if (country.equals(Country.IT)) { } //Partnership - parameters for matching based on wage and age differential - meanCovarianceParametricMatching = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "scenario_parametricMatching.xlsx", countryString, 1, 1); + meanCovarianceParametricMatching = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "scenario_parametricMatching.xlsx", "Parameters", 1, 1); //Fertility if (country.equals(Country.UK)) { @@ -1420,11 +1423,11 @@ else if (country.equals(Country.IT)) { } //Income - coeffCovarianceIncomeI3a = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I3a", 1, columnsIncomeI3a); - coeffCovarianceIncomeI3b = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I3b", 1, columnsIncomeI3b); - coeffCovarianceIncomeI4b = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I4b", 1, columnsIncomeI4b); - coeffCovarianceIncomeI5a_selection = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I5a", 1, columnsIncomeI5a); - coeffCovarianceIncomeI5b_amount = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I5b", 1, columnsIncomeI5b); + coeffCovarianceIncomeI3a = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I3a_amount", 1, columnsIncomeI3a); + coeffCovarianceIncomeI3b = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I3b_amount", 1, columnsIncomeI3b); + coeffCovarianceIncomeI4b = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I4b_amount", 1, columnsIncomeI4b); + coeffCovarianceIncomeI5a_selection = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I5a_selection", 1, columnsIncomeI5a); + coeffCovarianceIncomeI5b_amount = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I5a_amount", 1, columnsIncomeI5b); coeffCovarianceIncomeI3a_selection = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I3a_selection", 1, columnsIncomeI3a_selection); coeffCovarianceIncomeI3b_selection = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_income.xlsx", countryString + "_I3b_selection", 1, columnsIncomeI3b_selection); @@ -1556,8 +1559,8 @@ else if (country.equals(Country.IT)) { } //Health - regHealthH1a = new OrderedRegression<>(RegressionType.GenOrderedLogit, Dhe.class, coeffCovarianceHealthH1a); - regHealthH1b = new OrderedRegression<>(RegressionType.GenOrderedLogit, Dhe.class, coeffCovarianceHealthH1b); + regHealthH1a = new GeneralisedOrderedRegression<>(RegressionType.GenOrderedLogit, Dhe.class, coeffCovarianceHealthH1a); + regHealthH1b = new GeneralisedOrderedRegression<>(RegressionType.GenOrderedLogit, Dhe.class, coeffCovarianceHealthH1b); regHealthH2b = new BinomialRegression(RegressionType.Probit, Indicator.class, coeffCovarianceHealthH2b); //Social care @@ -1611,7 +1614,7 @@ else if (country.equals(Country.IT)) { regEducationE1a = new BinomialRegression(RegressionType.Probit, Indicator.class, coeffCovarianceEducationE1a); regEducationE1b = new BinomialRegression(RegressionType.Probit, Indicator.class, coeffCovarianceEducationE1b); - regEducationE2a = new OrderedRegression<>(RegressionType.GenOrderedLogit, Education.class, coeffCovarianceEducationE2a); + regEducationE2a = new GeneralisedOrderedRegression<>(RegressionType.GenOrderedLogit, Education.class, coeffCovarianceEducationE2a); //Partnership if (country.equals(Country.UK)) { @@ -2074,8 +2077,8 @@ public static void setEmploymentsFurloughedFlex(MultiKeyCoefficientMap employmen Parameters.employmentsFurloughedFlex = employmentsFurloughedFlex; } - public static OrderedRegression getRegHealthH1a() { return regHealthH1a; } - public static OrderedRegression getRegHealthH1b() { return regHealthH1b; } + public static GeneralisedOrderedRegression getRegHealthH1a() { return regHealthH1a; } + public static GeneralisedOrderedRegression getRegHealthH1b() { return regHealthH1b; } public static BinomialRegression getRegHealthH2b() { return regHealthH2b; } public static BinomialRegression getRegReceiveCareS1a() { return regReceiveCareS1a; } @@ -2125,7 +2128,7 @@ public static void setEmploymentsFurloughedFlex(MultiKeyCoefficientMap employmen public static BinomialRegression getRegEducationE1a() {return regEducationE1a;} public static BinomialRegression getRegEducationE1b() {return regEducationE1b;} - public static OrderedRegression getRegEducationE2a() {return regEducationE2a;} + public static GeneralisedOrderedRegression getRegEducationE2a() {return regEducationE2a;} public static LinearRegression getRegEQ5D() { return regHealthEQ5D; }; diff --git a/src/main/java/simpaths/data/RegressionName.java b/src/main/java/simpaths/data/RegressionName.java index 3d1605086..80757c7ad 100644 --- a/src/main/java/simpaths/data/RegressionName.java +++ b/src/main/java/simpaths/data/RegressionName.java @@ -9,7 +9,7 @@ public enum RegressionName { EducationE1a(RegressionType.Probit), EducationE1b(RegressionType.Probit), - EducationE2a(RegressionType.OrderedLogit), + EducationE2a(RegressionType.GenOrderedLogit), FertilityF1a(RegressionType.Probit), FertilityF1b(RegressionType.Probit), @@ -18,8 +18,8 @@ public enum RegressionName { PartnershipU1b(RegressionType.Probit), PartnershipU2b(RegressionType.Probit), - HealthH1a(RegressionType.OrderedLogit), - HealthH1b(RegressionType.OrderedLogit), + HealthH1a(RegressionType.GenOrderedLogit), + HealthH1b(RegressionType.GenOrderedLogit), HealthH2b(RegressionType.Probit), HealthHM1Level(RegressionType.Linear), diff --git a/src/main/java/simpaths/data/startingpop/DataParser.java b/src/main/java/simpaths/data/startingpop/DataParser.java index 16a99fdf6..caea2b1ee 100644 --- a/src/main/java/simpaths/data/startingpop/DataParser.java +++ b/src/main/java/simpaths/data/startingpop/DataParser.java @@ -162,10 +162,10 @@ private static void parse(String inputFileLocation, String inputFileName, Connec //DEMOGRAPHIC: Long-term sick or disabled (to be used with Indicator enum when defined in Person class) + "ALTER TABLE " + personTable + " ADD sick_longterm VARCHAR_IGNORECASE;" - + "UPDATE " + personTable + " SET sick_longterm = 'False' WHERE dlltsd = 0;" - + "UPDATE " + personTable + " SET sick_longterm = 'True' WHERE dlltsd = 1;" - + "ALTER TABLE " + personTable + " DROP COLUMN dlltsd;" - + "ALTER TABLE " + personTable + " ALTER COLUMN sick_longterm RENAME TO dlltsd;" + + "UPDATE " + personTable + " SET sick_longterm = 'False' WHERE dlltsd01 = 0;" + + "UPDATE " + personTable + " SET sick_longterm = 'True' WHERE dlltsd01 = 1;" + + "ALTER TABLE " + personTable + " DROP COLUMN dlltsd01;" + + "ALTER TABLE " + personTable + " ALTER COLUMN sick_longterm RENAME TO dlltsd;" // There are two versions of this variable in the Initial Population files. We use the dlltsd01, but we rename it dlltsd fo simplicity //DEMOGRAPHIC: Need social care (to be used with Indicator enum when defined in Person class) + "ALTER TABLE " + personTable + " ADD need_care VARCHAR_IGNORECASE;" @@ -176,13 +176,14 @@ private static void parse(String inputFileLocation, String inputFileName, Connec //DEMOGRAPHIC: Ethnicity + "ALTER TABLE " + personTable + " ADD ethnicity VARCHAR_IGNORECASE;" - + "UPDATE " + personTable + " SET ethnicity = 'White' WHERE dot = 1;" - + "UPDATE " + personTable + " SET ethnicity = 'Mixed' WHERE dot = 2;" - + "UPDATE " + personTable + " SET ethnicity = 'Asian' WHERE dot = 3;" - + "UPDATE " + personTable + " SET ethnicity = 'Black' WHERE dot = 4;" - + "UPDATE " + personTable + " SET ethnicity = 'Other' WHERE dot = 5;" - + "ALTER TABLE " + personTable + " DROP COLUMN dot;" - + "ALTER TABLE " + personTable + " ALTER COLUMN ethnicity RENAME TO dot;" + + "UPDATE " + personTable + " SET ethnicity = 'White' WHERE dot01 = 1;" + + "UPDATE " + personTable + " SET ethnicity = 'Mixed' WHERE dot01 = 2;" + + "UPDATE " + personTable + " SET ethnicity = 'Asian' WHERE dot01 = 3;" + + "UPDATE " + personTable + " SET ethnicity = 'Black' WHERE dot01 = 4;" + + "UPDATE " + personTable + " SET ethnicity = 'Other' WHERE dot01 = 5;" + + "UPDATE " + personTable + " SET ethnicity = 'Missing' WHERE dot01 = 6;" + + "ALTER TABLE " + personTable + " DROP COLUMN dot01;" + + "ALTER TABLE " + personTable + " ALTER COLUMN ethnicity RENAME TO dot01;" //SYSTEM: Year left education (to be used with Indicator enum when defined in Person class) + "ALTER TABLE " + personTable + " ADD education_left VARCHAR_IGNORECASE;" diff --git a/src/main/java/simpaths/experiment/SimPathsCollector.java b/src/main/java/simpaths/experiment/SimPathsCollector.java index 944618d3b..d95993a65 100644 --- a/src/main/java/simpaths/experiment/SimPathsCollector.java +++ b/src/main/java/simpaths/experiment/SimPathsCollector.java @@ -867,6 +867,13 @@ public int compare(Pair pair1, Pair pa } } + if (median == null) { + throw new IllegalStateException( + "Median could not be calculated — totalWeight=" + totalWeight + + ", households considered=" + arrHouse_eqHouseholdDispIncome.size() + ); + } + double atRiskOfPovertyThreshold = median * 0.6; // log.info("atRiskOfPovertyThreshold = " + atRiskOfPovertyThreshold); stats.setMedianEquivalisedHouseholdDisposableIncome(median); //Save median household equivalised disposable income in statistics object diff --git a/src/main/java/simpaths/experiment/SimPathsMultiRun.java b/src/main/java/simpaths/experiment/SimPathsMultiRun.java index 391f33d24..9cee44a0a 100644 --- a/src/main/java/simpaths/experiment/SimPathsMultiRun.java +++ b/src/main/java/simpaths/experiment/SimPathsMultiRun.java @@ -82,8 +82,10 @@ public static void main(String[] args) { try { if (lastDatabaseCountryAndYear.keySet().stream().anyMatch(key -> key.toString().equals("MultiKey[IT]"))) { countryString = "Italy"; + country = Country.IT; } else { countryString = "United Kingdom"; + country = Country.UK; } String valueYear = lastDatabaseCountryAndYear.getValue(country.toString()).toString(); startYear = Integer.parseInt(valueYear); diff --git a/src/main/java/simpaths/model/Person.java b/src/main/java/simpaths/model/Person.java index dc56a670f..b9a2bdd35 100644 --- a/src/main/java/simpaths/model/Person.java +++ b/src/main/java/simpaths/model/Person.java @@ -66,7 +66,7 @@ public class Person implements EventListener, IDoubleSource, IIntSource, Weight, @Transient private Education deh_c3_lag1; //Lag(1) of education level @Enumerated(EnumType.STRING) private Education dehm_c3; //Mother's education level @Enumerated(EnumType.STRING) private Education dehf_c3; //Father's education level - @Enumerated(EnumType.STRING) private Ethnicity dot; //Ethnicity + @Enumerated(EnumType.STRING) private Ethnicity dot01; //Ethnicity @Enumerated(EnumType.STRING) private Indicator ded; // in continuous education @Enumerated(EnumType.STRING) private Indicator der; // return to education @Enumerated(EnumType.STRING) private Les_c4 les_c4; //Activity (employment) status @@ -106,6 +106,7 @@ public class Person implements EventListener, IDoubleSource, IIntSource, Weight, // partner lags @Transient private Dcpst dcpst_lag1; // lag partnership status + @Transient private Dcpst dcpst_lag2; // lag (2) partnership status @Transient private Education dehsp_c3_lag1; //Lag(1) of partner's education @Transient private Dhe dhesp_lag1; @Transient private Lesdf_c4 lesdf_c4_lag1; //Lag(1) of own and partner's activity status @@ -131,6 +132,8 @@ public class Person implements EventListener, IDoubleSource, IIntSource, Weight, @Transient private Double dhe_mcs_lag1; //mental well-being: SF12 mental component summary score lag 1 private Double dhe_pcs; //physical well-being: SF12 physical component summary score @Transient private Double dhe_pcs_lag1; //physical well-being: SF12 physical component summary score lag 1 + private Double dhe_mcssp; //mental well-being: SF12 mental component summary score (partner) + private Double dhe_pcssp; //physical well-being: SF12 physical component summary score (partner) private Integer dls; //life satisfaction - score 1-7 @Transient private Double dls_temp; @Transient private Integer dls_lag1; //life satisfaction - score 1-7 lag 1 @@ -285,7 +288,7 @@ public Person(Gender gender, Person mother) { dhm = 9.; //Set to median for under 18's as a placeholder dhmGhq = false; deh_c3 = Education.Low; - dot = mother.getDot(); + dot01 = mother.getDot01(); les_c4 = Les_c4.Student; //Set lag activity status as Student, i.e. in education from birth leftEducation = false; les_c7_covid = Les_c7_covid.Student; @@ -376,7 +379,6 @@ else if (dag > Parameters.MAX_AGE_TO_LEAVE_CONTINUOUS_EDUCATION) } else { les_c4_lag1 = les_c4; } - les_c7_covid = originalPerson.les_c7_covid; if (originalPerson.les_c7_covid_lag1 != null) { //If original persons misses lagged activity status, assign current activity status les_c7_covid_lag1 = originalPerson.les_c7_covid_lag1; @@ -386,6 +388,7 @@ else if (dag > Parameters.MAX_AGE_TO_LEAVE_CONTINUOUS_EDUCATION) lesdf_c4_lag1 = originalPerson.lesdf_c4_lag1; dcpst_lag1 = originalPerson.dcpst_lag1; + dcpst_lag2= originalPerson.dcpst_lag2; ypnbihs_dv = originalPerson.getYpnbihs_dv(); ypnbihs_dv_lag1 = originalPerson.ypnbihs_dv_lag1; yptciihs_dv = Objects.requireNonNullElse(originalPerson.yptciihs_dv, 0.0); @@ -474,6 +477,8 @@ else if (dag > Parameters.MAX_AGE_TO_LEAVE_CONTINUOUS_EDUCATION) dls = originalPerson.dls; dhe_mcs = originalPerson.dhe_mcs; dhe_pcs = originalPerson.dhe_pcs; + dhe_mcssp = originalPerson.dhe_mcssp; + dhe_pcssp = originalPerson.dhe_pcssp; if (originalPerson.dls_lag1 != null) { dls_lag1 = originalPerson.dls_lag1; @@ -522,7 +527,7 @@ else if (dag > Parameters.MAX_AGE_TO_LEAVE_CONTINUOUS_EDUCATION) yearlyEquivalisedConsumption = originalPerson.yearlyEquivalisedConsumption; sIndexYearMap = new LinkedHashMap(); dhhOwned = originalPerson.dhhOwned; - dot = originalPerson.dot; + dot01 = originalPerson.dot01; receivesBenefitsFlag = originalPerson.receivesBenefitsFlag; receivesBenefitsFlag_L1 = originalPerson.receivesBenefitsFlag_L1; receivesBenefitsFlagNonUC = originalPerson.receivesBenefitsFlagNonUC; @@ -1869,6 +1874,12 @@ protected void updateVariables(boolean initialUpdate) { idFather = null; } + // Mental and Physical health status of the partner + if (this.getPartner() != null) { + this.setDhe_mcssp(getPartner().getDhe_mcssp()); + this.setDhe_pcssp(getPartner().getDhe_pcssp()); + } + //Lagged variables updateLaggedVariables(initialUpdate); @@ -1945,6 +1956,8 @@ private void updateLaggedVariables(boolean initialUpdate) { ypnoab_lag1 = getYpnoab(); } + dcpst_lag2 = dcpst_lag1; // Updating of this lag must occur before parnters variables are updated + // partner variables Person partner = getPartner(); if (partner!=null) { @@ -2264,6 +2277,7 @@ public enum DoublesVariables { Cut9, Cut10, D_children, + D_Children, D_children_2under, // Indicator (dummy variables for presence of children of certain ages in the benefitUnit) D_children_3_6, D_children_7_12, @@ -2290,6 +2304,7 @@ public enum DoublesVariables { Dcpst_Partnered, //Partnered Dcpst_PreviouslyPartnered, //Previously partnered Dcpst_PreviouslyPartnered_L1, //Lag(1) of partnership status is previously partnered + New_rel_L1, Dcpst_Single, //Single never married Dcpst_Single_L1, //Lag(1) of partnership status is Single Dcrisis, @@ -2344,30 +2359,55 @@ public enum DoublesVariables { Dhesp_Good_L1, Dhesp_VeryGood_L1, Dhesp_Excellent_L1, + Dhh_owned_L1, Dhhtp_c4_CoupleChildren_L1, Dhhtp_c4_CoupleNoChildren_L1, Dhhtp_c4_SingleChildren_L1, Dhhtp_c4_SingleNoChildren_L1, + L_Dhhtp_c4_CoupleChildren, + L_Dhhtp_c4_SingleChildren, + L_Dhhtp_c4_SingleNoChildren, + Dhhtp_c8_2_L1, + Dhhtp_c8_3_L1, + Dhhtp_c8_4_L1, + Dhhtp_c8_5_L1, + Dhhtp_c8_6_L1, + Dhhtp_c8_7_L1, + Dhhtp_c8_8_L1, Dhm, //Mental health status Dhm_L1, //Mental health status lag(1) Dls, //Life satisfaction status - Dls_L1, //Life satisfaction status lag(1) + Dls_L1, //Life satisfaction status lag(1) Dhe_mcs, //Mental well-being status - Dhe_mcs_L1, //Mental well-being status lag(1) + dhe_mcs, //Mental well-being status (lowercase) + Dhe_Mcs, + Dhe_mcs_L1, //Mental well-being status lag(1) + L_Dhe_mcs, + dhe_mcs_L1, //Mental well-being status lag(1) (lowercase) Dhe_mcs_sq, //MCS score squared Dhe_mcs_times_pcs, //MCS times PCS Dhe_mcs_c_times_pcs_c, //Centralised MCS times PCS Dhe_mcs_c, //MCS centralised by subtracting population mean Dhe_mcs_c_sq, //Square of centralised MCS + Dhe_mcssp_L1, //Mental well-being status of the partner Dhe_pcs, //Physical well-being status - Dhe_pcs_L1, //Physical well-being status lag(1) + dhe_pcs, //Physical well-being status (lowercase) + Dhe_Pcs, + Dhe_pcs_L1, //Physical well-being status lag(1) + L_Dhe_pcs, + dhe_pcs_L1, //Physical well-being status lag(1) (lowercase) Dhe_pcs_sq, //PCS score squared Dhe_pcs_cb, //PCS score cubed Dhe_pcs_c, //MCS centralised by subtracting population mean Dhe_pcs_c_sq, //Square of centralised MCS + Dhe_pcssp_L1, //Physical well-being status of the partner Dhmghq_L1, Dlltsd, //Long-term sick or disabled + Dlltsd01, Dlltsd_L1, //Long-term sick or disabled lag(1) + Dlltsd01_L1, + L_Dlltsd01, + Dlltsd01_sp_L1, Dnc_L1, //Lag(1) of number of children of all ages in the benefitUnit Dnc02_L1, //Lag(1) of number of children aged 0-2 in the benefitUnit Dnc017, //Number of children aged 0-17 in the benefitUnit @@ -2378,11 +2418,16 @@ public enum DoublesVariables { Employmentsonfullfurlough, EquivalisedConsumptionYearly, EquivalisedIncomeYearly, //Equivalised income for use with the security index - EthnicityWhite, - EthnicityMixed, + Ethn_White, + // Ethn_Mixed, + Ethn_Asian, EthnicityAsian, + Ethn_Black, EthnicityBlack, + Ethn_Other, EthnicityOther, + EthnicityMixed, + // Ethn_Missing, Female, FertilityRate, FinancialDistress, @@ -2397,6 +2442,7 @@ public enum DoublesVariables { LactiveIT, L1_hourly_wage, L1_log_hourly_wage, + Hourly_wage_L1, L1_log_hourly_wage_sq, Ld_children_2under, Ld_children_3under, @@ -2411,8 +2457,13 @@ public enum DoublesVariables { Lhw_40, // Used by financial distress process Les_c3_Employed_L1, Les_c3_NotEmployed_L1, + L_Les_c3_NotEmployed, Les_c3_Sick_L1, //This is based on dlltsd Les_c3_Student_L1, + L_Les_c3_Student, + Les_c4_Student_L1, + Les_c4_NotEmployed_L1, + Les_c4_Retired_L1, Les_c7_Covid_Furlough_L1, Lesdf_c4_BothNotEmployed_L1, Lesdf_c4_EmployedSpouseNotEmployed_L1, //Own and partner's activity status lag(1) @@ -2420,6 +2471,8 @@ public enum DoublesVariables { Lessp_c3_NotEmployed_L1, Lessp_c3_Sick_L1, Lessp_c3_Student_L1, //Partner variables + Lesnr_c2_NotEmployed_L1, + Reached_Retirement_Age_Lesnr_c2_NotEmployed_L1, Liwwh, //Work history in months LnAge, Lnonwork, @@ -2485,7 +2538,9 @@ public enum DoublesVariables { Year2018, Year2019, Year2020, + Y2020, Year2021, + Y2021, Year2022, Year2023, Year2024, @@ -2545,9 +2600,14 @@ public enum DoublesVariables { Year2078, Year2079, Ydses_c5_Q2_L1, //HH Income Lag(1) 2nd Quantile + L_Ydses_c5_Q2, Ydses_c5_Q3_L1, //HH Income Lag(1) 3rd Quantile + L_Ydses_c5_Q3, Ydses_c5_Q4_L1, //HH Income Lag(1) 4th Quantile + L_Ydses_c5_Q4, Ydses_c5_Q5_L1, //HH Income Lag(1) 5th Quantile + L_Ydses_c5_Q5, + Ydses_c5_L1, Year_transformed, //Year - 2000 Year_transformed_monetary, //Year-2000 that stops in 2017, for use with monetary processes Ynbcpdf_dv_L1, //Lag(1) of difference between own and partner's gross personal non-benefit income @@ -2815,6 +2875,9 @@ public double getDoubleValue(Enum variableID) { return dcpst_lag1.equals(Dcpst.PreviouslyPartnered) ? 1. : 0.; } else return 0.; } + case New_rel_L1 -> { + return (dcpst_lag1.equals(Dcpst.Partnered) && !dcpst_lag2.equals(Dcpst.Partnered))? 1. : 0.; + } case D_children_2under -> { return (double) benefitUnit.getIndicatorChildren(0, 2).ordinal(); } @@ -2830,7 +2893,7 @@ public double getDoubleValue(Enum variableID) { case D_children_18over -> { return (double) benefitUnit.getIndicatorChildren(18, 99).ordinal(); } - case D_children -> { + case D_children, D_Children -> { return (getNumberChildrenAll() > 0) ? 1. : 0.; } case Dnc_L1 -> { @@ -2931,10 +2994,10 @@ public double getDoubleValue(Enum variableID) { return dhm_lag1; } else return 0.; } - case Dhe_mcs -> { + case Dhe_mcs, dhe_mcs, Dhe_Mcs -> { return dhe_mcs; } - case Dhe_mcs_L1 -> { + case Dhe_mcs_L1, dhe_mcs_L1, L_Dhe_mcs -> { if (dhe_mcs_lag1 != null && dhe_mcs_lag1 >= 0.) { return dhe_mcs_lag1; } else return 0.; @@ -2959,10 +3022,21 @@ public double getDoubleValue(Enum variableID) { // Used to calculate he_eq5d in regHealthEQ5D return (dhe_mcs - 51.5) * (dhe_pcs - 49.9); } - case Dhe_pcs -> { + case Dhe_mcssp_L1 -> { + Person partner = getPartner(); + if (partner != null) { + if (partner.getDhe_mcs_lag1() != null) {return partner.getDhe_mcs_lag1();} + else throw new IllegalArgumentException( + "No Dhe_pcssp_L1 value." + partner.getKey().getId() + ); + } else throw new IllegalArgumentException( + "No partner found." + this.getKey().getId() + ); + } + case Dhe_pcs, dhe_pcs, Dhe_Pcs -> { return dhe_pcs; } - case Dhe_pcs_L1 -> { + case Dhe_pcs_L1, dhe_pcs_L1, L_Dhe_pcs -> { if (dhe_pcs_lag1 != null && dhe_pcs_lag1 >= 0.) { return dhe_pcs_lag1; } else return 0.; @@ -2983,6 +3057,17 @@ public double getDoubleValue(Enum variableID) { // Used to calculate he_eq5d in regHealthEQ5D return Math.pow(dhe_pcs - 49.9, 2); } + case Dhe_pcssp_L1 -> { + Person partner = getPartner(); + if (partner != null) { + if (partner.getDhe_pcs_lag1() != null){return partner.getDhe_pcs_lag1();} + else throw new IllegalArgumentException( + "No Dhe_pcssp_L1 value." + partner.getKey().getId() + ); + } else throw new IllegalArgumentException( + "No partner found." + this.getKey().getId() + ); + } case Dls -> { return dls; } @@ -3051,39 +3136,93 @@ public double getDoubleValue(Enum variableID) { case He_eq5d -> { return getHe_eq5d(); } - case Dhhtp_c4_CoupleChildren_L1 -> { + case Dhhtp_c4_CoupleChildren_L1, L_Dhhtp_c4_CoupleChildren -> { return (Dhhtp_c4.CoupleChildren.equals(getDhhtp_c4_lag1())) ? 1.0 : 0.0; } case Dhhtp_c4_CoupleNoChildren_L1 -> { return (Dhhtp_c4.CoupleNoChildren.equals(getDhhtp_c4_lag1())) ? 1.0 : 0.0; } - case Dhhtp_c4_SingleNoChildren_L1 -> { + case Dhhtp_c4_SingleNoChildren_L1, L_Dhhtp_c4_SingleNoChildren -> { return (Dhhtp_c4.SingleNoChildren.equals(getDhhtp_c4_lag1())) ? 1.0 : 0.0; } - case Dhhtp_c4_SingleChildren_L1 -> { + case Dhhtp_c4_SingleChildren_L1, L_Dhhtp_c4_SingleChildren -> { return (Dhhtp_c4.SingleChildren.equals(getDhhtp_c4_lag1())) ? 1.0 : 0.0; } - case Dlltsd -> { + case Dhhtp_c8_2_L1 -> { + // Couple with no children, spouse student + Person partner = getPartner(); + if (partner != null && partner.les_c4_lag1 != null) + return (partner.les_c4_lag1.equals(Les_c4.Student) && Dhhtp_c4.CoupleNoChildren.equals(getDhhtp_c4_lag1())) ? 1. : 0.; + else + return 0.; + } + case Dhhtp_c8_3_L1 -> { + // Couple with no children, spouse not employed + Person partner = getPartner(); + if (partner != null && partner.les_c4_lag1 != null) + return ((partner.les_c4_lag1.equals(Les_c4.NotEmployed) || partner.les_c4_lag1.equals(Les_c4.Retired)) && Dhhtp_c4.CoupleNoChildren.equals(getDhhtp_c4_lag1())) ? 1. : 0.; + else + return 0.; + } + case Dhhtp_c8_4_L1 -> { + // Couple with children, spouse employed + Person partner = getPartner(); + if (partner != null && partner.les_c4_lag1 != null) + return (partner.les_c4_lag1.equals(Les_c4.EmployedOrSelfEmployed) && Dhhtp_c4.CoupleChildren.equals(getDhhtp_c4_lag1())) ? 1. : 0.; + else + return 0.; + } + case Dhhtp_c8_5_L1 -> { + // Couple with children, spouse student + Person partner = getPartner(); + if (partner != null && partner.les_c4_lag1 != null) + return (partner.les_c4_lag1.equals(Les_c4.Student) && Dhhtp_c4.CoupleChildren.equals(getDhhtp_c4_lag1())) ? 1. : 0.; + else + return 0.; + } + case Dhhtp_c8_6_L1 -> { + // Couple with children, spouse not employed + Person partner = getPartner(); + if (partner != null && partner.les_c4_lag1 != null) + return ((partner.les_c4_lag1.equals(Les_c4.NotEmployed) || partner.les_c4_lag1.equals(Les_c4.Retired)) && Dhhtp_c4.CoupleChildren.equals(getDhhtp_c4_lag1())) ? 1. : 0.; + else + return 0.; + } + case Dhhtp_c8_7_L1 -> { + // Single with no children + return Dhhtp_c4.SingleNoChildren.equals(getDhhtp_c4_lag1()) ? 1. : 0.; + } + case Dhhtp_c8_8_L1 -> { + // Single with children + return Dhhtp_c4.SingleChildren.equals(getDhhtp_c4_lag1()) ? 1. : 0.; + } + case Dlltsd, Dlltsd01 -> { return Indicator.True.equals(dlltsd) ? 1. : 0.; } - case Dlltsd_L1 -> { + case Dlltsd_L1, Dlltsd01_L1, Dlltsd01_sp_L1, L_Dlltsd01 -> { return Indicator.True.equals(dlltsd_lag1) ? 1. : 0.; } - case EthnicityWhite -> { - return dot.equals(Ethnicity.White) ? 1. : 0.; + case Ethn_White -> { + return dot01.equals(Ethnicity.White) ? 1. : 0.; } - case EthnicityMixed -> { - return dot.equals(Ethnicity.Mixed) ? 1. : 0.; + // case Ethn_Mixed -> { + // return dot01.equals(Ethnicity.Mixed) ? 1. : 0.; + //} + case Ethn_Asian, EthnicityAsian -> { + return dot01.equals(Ethnicity.Asian) ? 1. : 0.; } - case EthnicityAsian -> { - return dot.equals(Ethnicity.Asian) ? 1. : 0.; + case Ethn_Black, EthnicityBlack -> { + return dot01.equals(Ethnicity.Black) ? 1. : 0.; } - case EthnicityBlack -> { - return dot.equals(Ethnicity.Black) ? 1. : 0.; + case Ethn_Other, EthnicityOther -> { + return (dot01.equals(Ethnicity.Other) || dot01.equals(Ethnicity.Missing)) ? 1. : 0.; } - case EthnicityOther -> { - return dot.equals(Ethnicity.Other) ? 1. : 0.; + case EthnicityMixed -> { + return dot01.equals(Ethnicity.Mixed) ? 1. : 0.; } + // case Ethn_Missing -> { + // return dot01.equals(Ethnicity.Missing) ? 1. : 0.; + // } case FertilityRate -> { if (ioFlag) return Parameters.getFertilityProjectionsByYear(getYear()); @@ -3131,10 +3270,10 @@ public double getDoubleValue(Enum variableID) { // log.debug("Lunion"); return household_status_lag.equals(HouseholdStatus.Couple) ? 1. : 0.; } - case Les_c3_Student_L1 -> { + case Les_c3_Student_L1, L_Les_c3_Student -> { return (Les_c4.Student.equals(les_c4_lag1)) ? 1.0 : 0.0; } - case Les_c3_NotEmployed_L1 -> { + case Les_c3_NotEmployed_L1, L_Les_c3_NotEmployed -> { return ((Les_c4.NotEmployed.equals(les_c4_lag1)) || (Les_c4.Retired.equals(les_c4_lag1))) ? 1.0 : 0.0; } case Les_c3_Employed_L1 -> { @@ -3146,6 +3285,15 @@ public double getDoubleValue(Enum variableID) { else return 0.0; } + case Les_c4_Student_L1 -> { + return (Les_c4.Student.equals(les_c4_lag1)) ? 1. : 0. ; + } + case Les_c4_NotEmployed_L1 -> { + return (Les_c4.NotEmployed.equals(les_c4_lag1)) ? 1. : 0. ; + } + case Les_c4_Retired_L1 -> { + return (Les_c4.Retired.equals(les_c4_lag1)) ? 1. : 0. ; + } case Lessp_c3_Student_L1 -> { Person partner = getPartner(); if (partner != null && partner.les_c4_lag1 != null) @@ -3167,6 +3315,26 @@ public double getDoubleValue(Enum variableID) { else return 0.; } + case Lesnr_c2_NotEmployed_L1 -> { + return (Les_c4.NotEmployed.equals(les_c4_lag1) || (Les_c4.Student.equals(les_c4_lag1))) ? 1. : 0. ; + } + case Reached_Retirement_Age_Lesnr_c2_NotEmployed_L1 -> { + int retirementAge; + if (dgn.equals(Gender.Female)) { + retirementAge = (int) Parameters.getTimeSeriesValue( + getYear(), + Gender.Female.toString(), + TimeSeriesVariable.FixedRetirementAge + ); + } else { + retirementAge = (int) Parameters.getTimeSeriesValue( + getYear(), + Gender.Male.toString(), + TimeSeriesVariable.FixedRetirementAge + ); + } + return (Les_c4.NotEmployed.equals(les_c4_lag1) || (Les_c4.Student.equals(les_c4_lag1)) && dag >= retirementAge) ? 1.0 : 0.0; + } case Retired -> { return Les_c4.Retired.equals(les_c4) ? 1. : 0.; } @@ -3263,10 +3431,10 @@ public double getDoubleValue(Enum variableID) { case Year2019 -> { return (getYear() == 2019) ? 1. : 0.; } - case Year2020 -> { + case Year2020, Y2020 -> { return (getYear() == 2020) ? 1. : 0.; } - case Year2021 -> { + case Year2021, Y2021 -> { return (getYear() == 2021) ? 1. : 0.; } case Year2022 -> { @@ -3449,16 +3617,16 @@ public double getDoubleValue(Enum variableID) { case Year_transformed_monetary -> { return (double) model.getTimeTrendStopsInMonetaryProcesses() - 2000; } //Note: this returns base price year - 2000 (e.g. 17 for 2017 as base price year) and monetary variables are then uprated from 2017 level to the simulated year - case Ydses_c5_Q2_L1 -> { + case Ydses_c5_Q2_L1, L_Ydses_c5_Q2, Ydses_c5_L1 -> { return (Ydses_c5.Q2.equals(getYdses_c5_lag1())) ? 1.0 : 0.0; } - case Ydses_c5_Q3_L1 -> { + case Ydses_c5_Q3_L1, L_Ydses_c5_Q3 -> { return (Ydses_c5.Q3.equals(getYdses_c5_lag1())) ? 1.0 : 0.0; } - case Ydses_c5_Q4_L1 -> { + case Ydses_c5_Q4_L1, L_Ydses_c5_Q4 -> { return (Ydses_c5.Q4.equals(getYdses_c5_lag1())) ? 1.0 : 0.0; } - case Ydses_c5_Q5_L1 -> { + case Ydses_c5_Q5_L1, L_Ydses_c5_Q5 -> { return (Ydses_c5.Q5.equals(getYdses_c5_lag1())) ? 1.0 : 0.0; } case Ypnbihs_dv_L1 -> { @@ -3629,7 +3797,7 @@ public double getDoubleValue(Enum variableID) { case D_Home_owner -> { return getBenefitUnit().isDhhOwned() ? 1. : 0.; } // Evaluated at the level of a benefit unit. If required, can be changed to individual-level homeownership status. - case D_Home_owner_L1 -> { + case D_Home_owner_L1, Dhh_owned_L1 -> { return isHomeOwner_lag1 ? 1. : 0.; } // Evaluated at the level of a benefit unit. If required, can be changed to individual-level homeownership status. case Covid_2020_D -> { @@ -3641,7 +3809,7 @@ public double getDoubleValue(Enum variableID) { case Pt -> { return (getLabourSupplyHoursWeekly() > 0 && getLabourSupplyHoursWeekly() < Parameters.MIN_HOURS_FULL_TIME_EMPLOYED) ? 1. : 0.; } - case L1_log_hourly_wage -> { + case L1_log_hourly_wage, Hourly_wage_L1 -> { if (L1_fullTimeHourlyEarningsPotential == null) { throw new RuntimeException("call to evaluate lag potential hourly earnings before initialisation"); } else { @@ -3919,7 +4087,6 @@ public void setLes_c4(Les_c4 les_c4) { this.les_c4 = les_c4; } - public void setLes_c7_covid(Les_c7_covid les_c7_covid) { this.les_c7_covid = les_c7_covid; } public Les_c7_covid getLes_c7_covid() { return les_c7_covid; } @@ -4368,8 +4535,12 @@ public void setDhmGhq(boolean dhm_ghq) { this.dhmGhq = dhm_ghq; } - public Ethnicity getDot() { - return dot; + public Ethnicity getDot01() { + return dot01; + } + + public void setDot01(Ethnicity dot01) { + this.dot01 = dot01; } public boolean getFinancialDistress() { @@ -5357,4 +5528,29 @@ public Double getHe_eq5d() { public void setHe_eq5d(Double he_eq5d) { this.he_eq5d = he_eq5d; } + + public Double getDhe_pcssp() { + return dhe_pcssp; + } + + public void setDhe_pcssp(Double dhe_pcssp) { + this.dhe_pcssp = dhe_pcssp; + } + + public Double getDhe_mcssp() { + return dhe_mcssp; + } + + public void setDhe_mcssp(Double dhe_mcssp) { + this.dhe_mcssp = dhe_mcssp; + } + + public Double getDhe_mcs_lag1() { + return dhe_mcs_lag1; + } + + public Double getDhe_pcs_lag1() { + return dhe_pcs_lag1; + } + } diff --git a/src/main/java/simpaths/model/SimPathsModel.java b/src/main/java/simpaths/model/SimPathsModel.java index 434b57432..f936fdb8a 100644 --- a/src/main/java/simpaths/model/SimPathsModel.java +++ b/src/main/java/simpaths/model/SimPathsModel.java @@ -105,9 +105,9 @@ public void setFirstRun(boolean firstRun) { private boolean fixTimeTrend = true; @GUIparameter(description = "Fix year used in the regressions to") - private Integer timeTrendStopsIn = 2021; + private Integer timeTrendStopsIn = 2023; - private Integer timeTrendStopsInMonetaryProcesses = 2021; // For monetary processes, time trend always continues to 2017 (last observed year in the estimation sample) and then values are grown at the growth rate read from Excel + private Integer timeTrendStopsInMonetaryProcesses = timeTrendStopsIn; // For monetary processes, time trend always continues to 2017 (last observed year in the estimation sample) and then values are grown at the growth rate read from Excel // @GUIparameter(description="Age at which people in initial population who are not employed are forced to retire") // private Integer ageNonWorkPeopleRetire = 65; //The problem is that it is difficult to find donor benefitUnits for non-zero labour supply for older people who are in the Nonwork category but not Retired. They should, in theory, still enter the Labour Market Module, but if we cannot find donor benefitUnits, how should we proceed? We avoid this problem by defining that people over the age specified here are retired off if they have activity_status equal to Nonwork. diff --git a/src/main/java/simpaths/model/enums/Ethnicity.java b/src/main/java/simpaths/model/enums/Ethnicity.java index 0c34775db..fa6a4d610 100644 --- a/src/main/java/simpaths/model/enums/Ethnicity.java +++ b/src/main/java/simpaths/model/enums/Ethnicity.java @@ -5,5 +5,6 @@ public enum Ethnicity { Mixed, // "Mixed or Multiple ethnic groups" Asian, // "Asian or Asian British" Black, // "Black, Black British, Caribbean, or African" - Other, // "Other or missing ethnic group" + Other, // "Other ethnic group" + Missing, // } diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index fc00ea6e1..8fb382283 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -52,6 +52,7 @@ org.hibernate.jpa.HibernatePersistenceProvider + META-INF/microsim.xml simpaths.data.startingpop.Processed simpaths.model.Household simpaths.model.Person @@ -59,6 +60,8 @@ simpaths.data.statistics.Statistics simpaths.data.statistics.Statistics2 simpaths.data.statistics.Statistics3 + simpaths.data.statistics.HealthStatistics + simpaths.data.statistics.EmploymentStatistics false