diff --git a/changelog.d/uprating-factors-load-time.fixed.md b/changelog.d/uprating-factors-load-time.fixed.md new file mode 100644 index 00000000..83d7d187 --- /dev/null +++ b/changelog.d/uprating-factors-load-time.fixed.md @@ -0,0 +1 @@ +Regenerate `storage/uprating_factors.csv` (last built 2026-05-20) from the uprating policyengine-uk applies to a dataset at load (the year-on-year growth in its `uprating_indices.yaml`) rather than from each variable's `uprating` attribute, keeping the household-weight and road-fuel overrides and storing six decimal places. The stale table moved the FRS to the 2025 calibration year with 2024-25 growth of 3.7% for earnings (policyengine-uk 2.93.0: 5.3%), 4.7% for self-employment income (0.7%) and 2.8% for GDP-indexed incomes and wealth (4.4%), and uprated salary-sacrificed pension contributions, water charges and service charges, which policyengine-uk carries unchanged, so calibration now fits the values the model runs on. The SPI income projections are regenerated with the new table, and the salary sacrifice headcount targets compare contributions with the £2,000 cap as simulated instead of deflating them through a table row that no longer exists. diff --git a/policyengine_uk_data/datasets/create_datasets.py b/policyengine_uk_data/datasets/create_datasets.py index 31008183..e005aa6d 100644 --- a/policyengine_uk_data/datasets/create_datasets.py +++ b/policyengine_uk_data/datasets/create_datasets.py @@ -337,13 +337,15 @@ def main(): # materialisation on purpose. Rail and bus (subsidy and fares) are # fitted by simulating the saved base-year file at the calibration # year, the configuration consumers actually run: policyengine-uk - # re-uprates rail_usage (gov.dft.rail.ridership_index) and - # bus_fare_spending (CPI) at load, so a factor fitted on a - # calibration-year file and then down-rated would be uprated a - # second time. rail_usage, rail_subsidy_spending, - # bus_subsidy_spending and bus_fare_spending are not in + # re-uprates bus_fare_spending (CPI) at load, so a factor fitted + # on a calibration-year file and then down-rated would be uprated + # a second time. (rail_usage declares gov.dft.rail.ridership_index, + # but policyengine-uk carries it forward unchanged at load because + # uprating_indices.yaml does not list it.) rail_usage, + # rail_subsidy_spending and bus_subsidy_spending are not in # uprating_factors.csv, so `uprate_dataset` leaves them untouched - # in either direction: uprating the saved file back to the + # in either direction, and bus_fare_spending moves by the same CPI + # factor both ways: uprating the saved file back to the # calibration year reproduces the calibrated weights and monetary # levels but keeps these post-calibration scalings, which the # weight solve never saw. The saved file is therefore not diff --git a/policyengine_uk_data/storage/incomes_projection.csv b/policyengine_uk_data/storage/incomes_projection.csv index b8db818e..aa9bda2d 100644 --- a/policyengine_uk_data/storage/incomes_projection.csv +++ b/policyengine_uk_data/storage/incomes_projection.csv @@ -13,73 +13,73 @@ total_income_lower_bound,total_income_upper_bound,employment_income_count,employ 500000,1000000.0,44000,23100000000,15000,6670000000,3000,43000000,4000,640000000,13000,474000000,38000,653000000,32000,3820000000,2024 1000000,inf,21000,35500000000,11000,19500000000,2000,20000000,2000,370000000,7000,439000000,21000,1240000000,19000,11100000000,2024 12570,inf,27263000,1084200000000,3670000,107480000000,7977000,85220000000,9175000,127760000000,2351000,29358000000,19573000,18343000000,4092000,71770000000,2024 -12570,15000.0,1375891,17529896907,449188,5033426819,1153320,12181568310,1082502,4556072351,102180,688579832,1264606,281598319,116344,179852941,2025 -15000,20000.0,3136222,50411419508,658607,8402997371,2073953,22917865804,2165005,14244272179,234711,1736865546,2873184,1407991597,376347,878710084,2025 -20000,30000.0,7557283,178410785091,972229,16429272568,2347108,25705173808,2691081,31630663221,436036,3925932773,5311344,3216798319,852850,3422344538,2025 -30000,40000.0,5432746,176336241079,601952,13185276074,1173554,12697736459,1466943,26079586563,368253,3905378151,3733116,2600159664,674794,4830336134,2025 -40000,50000.0,3540896,144180808882,363195,9135512708,574637,6214664511,788102,17700602929,328797,3884823529,2397692,1921857143,634326,8632941176,2025 -50000,70000.0,3470078,180485329104,314634,8601822962,446153,4810687146,650513,18224289406,401639,5549747899,2256056,2404890756,650513,12846638655,2025 -70000,100000.0,1659163,122398096749,144671,5608974584,178056,1951115602,262026,9918621878,228641,3874546218,1082502,1664924370,339926,9701781513,2025 -100000,150000.0,800242,85367486122,85993,5211323401,74865,874388844,110274,5687235142,138601,2620714286,494714,1294941176,224594,7060512605,2025 -150000,200000.0,267085,40661062649,40467,3819544259,21245,273569119,29339,1895745047,54631,1181890756,147706,668025210,93075,3545672269,2025 -200000,300000.0,182103,37964155432,34397,4593917616,14164,184788197,20234,1644375538,41479,1079117647,112297,753326891,75876,3802605042,2025 -300000,500000.0,94087,30080888184,21245,5064820333,8093,99104285,10117,1173057709,23269,786214286,68795,691663025,49573,3525117647,2025 -500000,1000000.0,44514,23960983347,15175,6979824715,3035,44390461,4047,670318691,13152,487144538,38444,671108403,32374,3925932773,2025 -1000000,inf,21245,36823156225,11129,20405784400,2023,20646726,2023,387527993,7082,451173950,21245,1274386555,19222,11407815126,2025 -12570,inf,27581555,1124610309278,3712882,112472497809,8070207,87975699272,9282205,133812368648,2378470,30172129412,19801701,18851671429,4139813,73760260504,2025 -12570,15000.0,1385161,17918556701,452214,5189404032,1161091,12410509297,1089796,4724677003,102869,708285714,1273126,289657143,117128,185000000,2026 -15000,20000.0,3157352,51529103886,663044,8663391762,2087926,23348585287,2179591,14771403962,236292,1786571429,2892541,1448285714,378882,903857143,2026 -20000,30000.0,7608199,182366375892,978779,16938387379,2362921,26188278092,2709211,32801205857,438974,4038285714,5347128,3308857143,858596,3520285714,2026 -30000,40000.0,5469348,180245836638,606008,13593865031,1181461,12936378335,1476826,27044702842,370734,4017142857,3758267,2674571429,679340,4968571429,2026 -40000,50000.0,3564752,147377478192,365642,9418606486,578508,6331463217,793412,18355641688,331013,3996000000,2413846,1976857143,638600,8880000000,2026 -50000,70000.0,3493457,184486915147,316754,8868378615,449159,4901099434,654896,18898708010,404345,5708571429,2271256,2473714286,654896,13214285714,2026 -70000,100000.0,1670341,125111816019,145646,5782787029,179256,1987784964,263792,10285676141,230181,3985428571,1089796,1712571429,342216,9979428571,2026 -100000,150000.0,805634,87260190325,86573,5372813322,75369,890822150,111017,5897700258,139535,2695714286,498047,1332000000,226107,7262571429,2026 -150000,200000.0,268884,41562569389,40740,3937905346,21389,278710590,29537,1965900086,54999,1215714286,148701,687142857,93702,3647142857,2026 -200000,300000.0,183330,38805868358,34629,4736275197,14259,188261116,20370,1705228252,41759,1110000000,113054,774885714,76388,3911428571,2026 -300000,500000.0,94721,30747819191,21389,5221770377,8148,100966855,10185,1216468562,23426,808714286,69258,711457143,49907,3626000000,2026 -500000,1000000.0,44814,24492228390,15278,7196117441,3056,45224737,4074,695124892,13241,501085714,38703,690314286,32592,4038285714,2026 -1000000,inf,21389,37639571768,11204,21038124452,2037,21034762,2037,401869078,7130,464085714,21389,1310857143,19352,11734285714,2026 -12570,inf,27767379,1149544329897,3737897,115957826468,8124578,89629118836,9344742,138764306632,2394495,31035600000,19935110,19391171429,4167704,75871142857,2026 -12570,15000.0,1395755,18293814433,455673,5353812445,1169971,12658528698,1098130,4825839793,103655,730243697,1282863,298636975,118023,190735294,2027 -15000,20000.0,3181500,52608247423,668115,8937861525,2103895,23815198060,2196261,15087683032,238099,1841957983,2914664,1493184874,381780,931878151,2027 -20000,30000.0,7666388,186185567010,986265,17475021911,2380993,26711641067,2729932,33503531438,442331,4163478992,5388023,3411436975,865163,3629420168,2027 -30000,40000.0,5511178,184020618557,610643,14024539877,1190497,13194907033,1488121,27623772610,373570,4141680672,3787011,2757487395,684536,5122605042,2027 -40000,50000.0,3592016,150463917526,368438,9717002629,582933,6457995150,799480,18748664944,333544,4119882353,2432308,2038142857,643484,9155294118,2027 -50000,70000.0,3520175,188350515464,319176,9149342682,452594,4999046079,659905,19303359173,407437,5885546218,2288627,2550403361,659905,13623949580,2027 -70000,100000.0,1683116,127731958763,146759,5965994741,180627,2027510105,265809,10505908699,231942,4108983193,1098130,1765663866,344833,10288806723,2027 -100000,150000.0,811796,89087628866,87235,5543032428,75945,908624899,111866,6023979328,140602,2779285714,501856,1373294118,227836,7487722689,2027 -150000,200000.0,270941,42432989691,41052,4062664330,21552,284280517,29762,2007993109,55420,1253403361,149838,708445378,94419,3760210084,2027 -200000,300000.0,184732,39618556701,34894,4886327783,14368,192023444,20526,1741739879,42078,1144411765,113918,798908403,76972,4032689076,2027 -300000,500000.0,95445,31391752577,21552,5387204207,8210,102984640,10263,1242515073,23605,833785714,69788,733513445,50288,3738411765,2027 -500000,1000000.0,45157,25005154639,15394,7424101665,3079,46128537,4105,710008613,13342,516620168,38999,711715126,32841,4163478992,2027 -1000000,inf,21552,38427835052,11289,21704645048,2053,21455133,2053,410473730,7184,478473109,21552,1351495798,19500,12098067227,2027 -12570,inf,27979749,1173618556701,3766485,119631551271,8186717,91420323363,9416212,141735469423,2412808,31997752941,20087577,19992328571,4199579,78223268908,2027 -12570,15000.0,1401052,18709278351,457402,5543514461,1174411,12906548100,1102298,4927002584,104049,754453782,1287731,308537815,118471,197058824,2028 -15000,20000.0,3193574,53803013481,670650,9254557406,2111879,24281810833,2204596,15403962102,239003,1903025210,2925725,1542689076,383229,962773109,2028 -20000,30000.0,7695482,190413957177,990008,18094215600,2390029,27235004042,2740292,34205857020,444010,4301512605,5408471,3524537815,868446,3749747899,2028 -30000,40000.0,5532093,188199841396,612960,14521472393,1195015,13453435732,1493768,28202842377,374987,4278991597,3801383,2848907563,687133,5292436975,2028 -40000,50000.0,3605648,153881046788,369836,10061305872,585145,6584527082,802514,19141688200,334810,4256470588,2441538,2105714286,645926,9458823529,2028 -50000,70000.0,3533535,192628072958,320388,9473531989,454312,5096992724,662409,19708010336,408983,6080672269,2297313,2634957983,662409,14075630252,2028 -70000,100000.0,1689503,130632831086,147316,6177388256,181313,2067235247,266818,10726141258,232822,4245210084,1102298,1824201681,346142,10629915966,2028 -100000,150000.0,814876,91110864393,87566,5739439089,76234,926427648,112290,6150258398,141135,2871428571,503760,1418823529,228701,7735966387,2028 -150000,200000.0,271969,43396669310,41207,4206617003,21634,289850445,29875,2050086133,55630,1294957983,150407,731932773,94777,3884873950,2028 -200000,300000.0,185433,40518318795,35026,5059465381,14423,195785772,20604,1778251507,42238,1182352941,114351,825394958,77264,4166386555,2028 -300000,500000.0,95807,32104678826,21634,5578089395,8241,105002425,10302,1268561585,23694,861428571,70053,757831933,50479,3862352941,2028 -500000,1000000.0,45328,25573037272,15453,7687160386,3091,47032336,4121,724892334,13392,533747899,39147,735310924,32966,4301512605,2028 -1000000,inf,21634,39300555115,11332,22473707274,2060,21875505,2060,419078381,7211,494336134,21634,1396302521,19574,12499159664,2028 -12570,inf,28085934,1200272164948,3780779,123870464505,8217786,93211527890,9451947,144706632214,2421965,33058588235,20163811,20655142857,4215517,80816638655,2028 -12570,15000.0,1408997,19178350515,459996,5754294479,1181071,13164106710,1108549,5043152455,104639,779226891,1295034,318668908,119143,203529412,2029 -15000,20000.0,3211685,55151942902,674454,9606441718,2123856,24766370251,2217098,15767097330,240358,1965512605,2942317,1593344538,385402,994386555,2029 -20000,30000.0,7739124,195187946075,995622,18782208589,2403583,27778496362,2755833,35012230835,446528,4442756303,5439143,3640268908,873371,3872873950,2029 -30000,40000.0,5563466,192918318795,616436,15073619632,1201792,13721907842,1502240,28867700258,377114,4419495798,3822941,2942453782,691030,5466218487,2029 -40000,50000.0,3626095,157739095956,371934,10443865031,588463,6715925627,807065,19592937123,336709,4396235294,2455385,2174857143,649589,9769411765,2029 -50000,70000.0,3553574,197457573354,322204,9833742331,456888,5198706548,666166,20172609819,411303,6280336134,2310341,2721478992,666166,14537815126,2029 -70000,100000.0,1699085,133908009516,148152,6412269939,182341,2108488278,268331,10979000861,234142,4384605042,1108549,1884100840,348105,10978957983,2029 -100000,150000.0,819498,93395162569,88062,5957668712,76666,944915117,112927,6295245478,141936,2965714286,506617,1465411765,229998,7989983193,2029 -150000,200000.0,273511,44484694687,41441,4366564417,21757,295634600,30045,2098415159,55945,1337478992,151260,755966387,95315,4012436975,2029 -200000,300000.0,186485,41534179223,35225,5251840491,14504,199692805,20721,1820172265,42477,1221176471,114999,852497479,77702,4303193277,2029 -300000,500000.0,96351,32909595559,21757,5790184049,8288,107097817,10360,1298466839,23829,889714286,70450,782715966,50765,3989176471,2029 -500000,1000000.0,45585,26214195083,15540,7979447853,3108,47970897,4144,741981051,13468,551273950,39369,759455462,33153,4442756303,2029 -1000000,inf,21757,40285884219,11396,23328220859,2072,22312045,2072,428957795,7252,510568067,21757,1442151261,19685,12909579832,2029 -12570,inf,28245211,1230364948454,3802220,128580368098,8264389,95071624899,9505550,148117967270,2435700,34144094118,20278162,21333371429,4239424,83470319328,2029 +12570,15000.0,1375891,17795688094,449188,4843188790,1153320,12201198978,1082502,4506163433,102180,699345737,1264606,286001092,116344,182664931,2025 +15000,20000.0,3136222,51175765762,658607,8085406650,2073953,22954798078,2165005,14088235102,234711,1764021335,2873184,1430005461,376347,892448664,2025 +20000,30000.0,7557283,181115878830,972229,15808329316,2347108,25746597844,2691081,31284169123,436036,3987314498,5311344,3267092769,852850,3475852690,2025 +30000,40000.0,5432746,179009880239,601952,12686939451,1173554,12718198935,1466943,25793901032,368253,3966438506,3733116,2640813005,674794,4905858152,2025 +40000,50000.0,3540896,146366902077,363195,8790236620,574637,6224679479,788102,17506703913,328797,3945562513,2397692,1951905265,634326,8767916697,2025 +50000,70000.0,3470078,183221877421,314634,8276717642,446153,4818439597,650513,18024653733,401639,5636517876,2256056,2442491080,650513,13047495084,2025 +70000,100000.0,1659163,124253916871,144671,5396983767,178056,1954259836,262026,9809969589,228641,3935124517,1082502,1690955363,339926,9853468288,2025 +100000,150000.0,800242,86661842021,85993,5014361783,74865,875797927,110274,5624935044,138601,2661688997,494714,1315187504,224594,7170903298,2025 +150000,200000.0,267085,41277572384,40467,3675184841,21245,274009977,29339,1874978348,54631,1200369548,147706,678469744,93075,3601108643,2025 +200000,300000.0,182103,38539774216,34397,4420290809,14164,185085985,20234,1626362435,41479,1095989587,112297,765105112,75876,3862058545,2025 +300000,500000.0,94087,30536979570,21245,4873395789,8093,99263992,10117,1160207597,23269,798506699,68795,702477135,49573,3580232651,2025 +500000,1000000.0,44514,24324283727,15175,6716022709,3035,44461996,4047,662975769,13152,494761014,38444,681601143,32374,3987314498,2025 +1000000,inf,21245,37381474991,11129,19634549151,2023,20679998,2023,383282867,7082,458228027,21245,1294311512,19222,11586175635,2025 +12570,inf,27581555,1141661836204,3712882,108221607319,8070207,88117472623,9282205,132346537984,2378470,30643868854,19801701,19146416186,4139813,74913497775,2025 +12570,15000.0,1385161,18400750621,452214,4991391904,1161091,12481831123,1089796,4690916055,102869,719766739,1273126,294352368,117128,187998775,2026 +15000,20000.0,3157352,52915768057,663044,8332822659,2087926,23482767029,2179591,14665852495,236292,1815531028,2892541,1471761839,378882,918508301,2026 +20000,30000.0,7608199,187273911644,978779,16292069209,2362921,26338779235,2709211,32566819510,438974,4103744689,5347128,3362492376,858596,3577348119,2026 +30000,40000.0,5469348,185096308020,606008,13075163824,1181461,13010722273,1476826,26851450524,370734,4082259115,3758267,2717925148,679340,5049109958,2026 +40000,50000.0,3564752,151343451852,365642,9059220649,578508,6367849438,793412,18224478468,331013,4060773541,2413846,2008901196,638600,9023941202,2026 +50000,70000.0,3493457,189451515267,316754,8529987828,449159,4929265511,654896,18763664221,404345,5801105058,2271256,2513812192,654896,13428483931,2026 +70000,100000.0,1670341,128478613802,145646,5562133182,179256,1999208544,263792,10212178171,230181,4050030754,1089796,1740331518,342216,10141191065,2026 +100000,150000.0,805634,89608389118,86573,5167802845,75369,895941607,111017,5855557283,139535,2739410722,498047,1353591180,226107,7380294769,2026 +150000,200000.0,268884,42681031026,40740,3787646663,21389,280312309,29537,1951852428,54999,1235420522,148701,698281164,93702,3706261565,2026 +200000,300000.0,183330,39850146315,34629,4555553110,14259,189343031,20370,1693043266,41759,1127992650,113054,787446298,76388,3974831244,2026 +300000,500000.0,94721,31575252545,21389,5022523247,8148,101547101,10185,1207776088,23426,821823217,69258,722989575,49907,3684775991,2026 +500000,1000000.0,44814,25151321854,15278,6921535135,3056,45484639,4074,690157764,13241,509208111,38703,701504001,32592,4103744689,2026 +1000000,inf,21389,38652464322,11204,20235372584,2037,21155646,2037,398997458,7130,471608356,21389,1332105606,19352,11924493731,2026 +12570,inf,27767379,1180478924442,3737897,111533222839,8124578,90144207486,9344742,137772743731,2394495,31538674501,19935110,19705494460,4167704,77100983340,2026 +12570,15000.0,1395755,18842365727,455673,5176573740,1169971,12731467935,1098130,4836334659,103655,743015304,1282863,303859990,118023,194071161,2027 +15000,20000.0,3181500,54185738125,668115,8641972377,2103895,23952422725,2196261,15120494566,238099,1874172930,2914664,1519299949,381780,948176246,2027 +20000,30000.0,7666388,191768455916,986265,16896508881,2380993,26865555219,2729932,33576392346,442331,4236296209,5388023,3471101344,865163,3692896957,2027 +30000,40000.0,5511178,189538590149,610643,13560255535,1190497,13270936915,1488121,27683846669,373570,4214116647,3787011,2805714505,684536,5212196906,2027 +40000,50000.0,3592016,154975670769,368438,9395319907,582933,6495206523,799480,18789438101,333544,4191937086,2432308,2073788982,643484,9315415747,2027 +50000,70000.0,3520175,193998321682,319176,8846452421,452594,5027850896,659905,19345338636,407437,5988481552,2288627,2595008672,659905,13862225814,2027 +70000,100000.0,1683116,131562080221,146759,5768489656,180627,2039192746,265809,10528756143,231942,4180847305,1098130,1796544465,344833,10468752935,2027 +100000,150000.0,811796,91758976290,87235,5359529569,75945,913860453,111866,6037079816,140602,2827894066,501856,1397312362,227836,7618679307,2027 +150000,200000.0,270941,43705369023,41052,3928169262,21552,285918560,29762,2012359939,55420,1275324775,149838,720835742,94419,3825974325,2027 +200000,300000.0,184732,40806543526,34894,4724565222,14368,193129895,20526,1745527682,42078,1164426968,113918,812880922,76972,4103218841,2027 +300000,500000.0,95445,32333053614,21552,5208860063,8210,103578044,10263,1245217200,23605,848368220,69788,746342238,50288,3803794763,2027 +500000,1000000.0,45157,25754949603,15394,7178325748,3079,46394332,4105,711552685,13342,525655603,38999,724162677,32841,4236296209,2027 +1000000,inf,21552,39580117355,11289,20986109757,2053,21578759,2053,411366396,7184,486841371,21552,1375132801,19500,12309656523,2027 +12570,inf,27979749,1208810232000,3766485,115671132138,8186717,91947093002,9416212,142043704838,2412808,32557378036,20087577,20341984648,4199579,79591355733,2027 +12570,15000.0,1401052,19238055016,457402,5364999173,1174411,12986098807,1102298,4981427321,104049,766048722,1287731,313279627,118471,200087353,2028 +15000,20000.0,3193574,55323637503,670650,8956537080,2111879,24431474027,2204596,15574117602,239003,1932272150,2925725,1566398134,383229,977569638,2028 +20000,30000.0,7695482,195795589515,990008,17511535761,2390029,27402869517,2740292,34583702323,444010,4367621074,5408471,3578705225,868446,3807376486,2028 +30000,40000.0,5532093,193518896614,612960,14053843987,1195015,13536357231,1493768,28514377081,374987,4344753948,3801383,2892691444,687133,5373774619,2028 +40000,50000.0,3605648,158230156643,369836,9737306191,585145,6625111425,802514,19353131432,334810,4321886822,2441538,2138076285,645926,9604192937,2028 +50000,70000.0,3533535,198072282416,320388,9168460125,454312,5128408512,662409,19925709286,408983,6174124031,2297313,2675453747,662409,14291953775,2028 +70000,100000.0,1689503,134324881179,147316,5978460617,181313,2079976843,266818,10844624536,232822,4310453259,1102298,1852237209,346142,10793283491,2028 +100000,150000.0,814876,93685912890,87566,5554614528,76234,932137770,112290,6218195484,141135,2915558570,503760,1440628941,228701,7854857795,2028 +150000,200000.0,271969,44623180866,41207,4071153218,21634,291636965,29875,2072731828,55630,1314859747,150407,743181596,94777,3944579242,2028 +200000,300000.0,185433,41663480094,35026,4896537706,14423,196992516,20604,1797894459,42238,1200524117,114351,838080169,77264,4230418317,2028 +300000,500000.0,95807,33012047069,21634,5398460706,8241,105649617,10302,1282574391,23694,874667571,70053,769478791,50479,3921712116,2028 +500000,1000000.0,45328,26295803010,15453,7439614237,3091,47322224,4121,732899652,13392,541950887,39147,746611665,32966,4367621074,2028 +1000000,inf,21634,40411298999,11332,21749996646,2060,22010337,2060,423707611,7211,501933417,21634,1417761814,19574,12691254952,2028 +12570,inf,28085934,1234195221815,3780779,119881519976,8217786,93786045792,9451947,146305093007,2421965,33566654314,20163811,20972584647,4215517,82058681794,2028 +12570,15000.0,1408997,19661286328,459996,5554383918,1181071,13245818324,1108549,5120904049,104639,788723905,1295034,322552761,119143,206009975,2029 +15000,20000.0,3211685,56540740564,674454,9272703298,2123856,24920098881,2217098,16010182775,240358,1989467760,2942317,1612763805,385402,1006505878,2029 +20000,30000.0,7739124,200103032447,995622,18129693871,2403583,27950921718,2755833,35552023516,446528,4496903457,5439143,3684635555,873371,3920075527,2029 +30000,40000.0,5563466,197776253000,616436,14549945400,1201792,13807081812,1502240,29312761111,377114,4473359460,3822941,2978315640,691030,5532839332,2029 +40000,50000.0,3626095,161711171571,371934,10081033598,588463,6757612399,807065,19895006537,336709,4449815463,2455385,2201363734,649589,9888478806,2029 +50000,70000.0,3553574,202429811895,322204,9492107237,456888,5230975711,666166,20483616198,411303,6356879232,2310341,2754647667,666166,14714998223,2029 +70000,100000.0,1699085,137279987377,148152,6189500583,182341,2121575986,268331,11148266977,234142,4438043464,1108549,1907063770,348105,11112766658,2029 +100000,150000.0,819498,95746974247,88062,5750692706,76666,950780349,112927,6392300917,141936,3001859637,506617,1483271821,229998,8087363023,2029 +150000,200000.0,273511,45604877162,41441,4214865136,21757,297469649,30045,2130766972,55945,1353779836,151260,765179908,95315,4061339509,2029 +200000,300000.0,186485,42580063881,35225,5069385738,14504,200932329,20721,1848234335,42477,1236059851,114999,862887496,77702,4355639474,2029 +300000,500000.0,96351,33738301982,21757,5589026646,8288,107762590,10360,1318485640,23829,900557891,70450,792255504,50765,4037795512,2029 +500000,1000000.0,45585,26874302614,15540,7702233001,3108,48268660,4144,753420366,13468,557992733,39369,768711507,33153,4496903457,2029 +1000000,inf,21757,41300335185,11396,22517772642,2072,22450540,2072,435571149,7252,516790738,21757,1459727824,19685,13066918422,2029 +12570,inf,28245211,1261347138253,3802220,124113343773,8264389,95661748947,9505550,150401540542,2435700,34560233426,20278162,21593376992,4239424,84487633796,2029 diff --git a/policyengine_uk_data/storage/uprating_factors.csv b/policyengine_uk_data/storage/uprating_factors.csv index 149ef19f..d6c4229b 100644 --- a/policyengine_uk_data/storage/uprating_factors.csv +++ b/policyengine_uk_data/storage/uprating_factors.csv @@ -1,81 +1,85 @@ Variable,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034 -afcs_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -alcohol_and_tobacco_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -benunit_rent,1.0,1.0,1.0,1.11,1.184,1.223,1.275,1.312,1.351,1.392,1.392,1.392,1.392,1.392,1.392 -bsp_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -capital_gains,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -capital_gains_before_response,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -carers_allowance_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -child_benefit_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -child_tax_credit_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -childcare_expenses,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -clothing_and_footwear_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -communication_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -corporate_wealth,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -diesel_spending,1.0,1.138,1.57,1.539,1.589,1.54,1.507,1.46,1.415,1.355,1.284,1.284,1.284,1.284,1.284 -dividend_income,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -domestic_energy_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -education_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -employee_pension_contributions,1.0,1.059,1.127,1.205,1.261,1.308,1.337,1.365,1.396,1.431,1.431,1.431,1.431,1.431,1.431 -employer_pension_contributions,1.0,1.059,1.127,1.205,1.261,1.308,1.337,1.365,1.396,1.431,1.431,1.431,1.431,1.431,1.431 -pension_contributions_via_salary_sacrifice,1.0,1.059,1.127,1.205,1.261,1.308,1.337,1.365,1.396,1.431,1.431,1.431,1.431,1.431,1.431 -employment_income,1.0,1.059,1.127,1.205,1.261,1.308,1.337,1.365,1.396,1.431,1.431,1.431,1.431,1.431,1.431 -employment_income_before_lsr,1.0,1.059,1.127,1.205,1.261,1.308,1.337,1.365,1.396,1.431,1.431,1.431,1.431,1.431,1.431 -esa_contrib_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -esa_income_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -food_and_non_alcoholic_beverages_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -free_school_fruit_veg,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -free_school_meals,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -free_school_milk,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -gross_financial_wealth,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -health_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -household_furnishings_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 +afcs_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +alcohol_and_tobacco_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +bsp_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +bus_fare_spending,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +bus_fare_spending_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +capital_gains,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +capital_gains_badr,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +capital_gains_before_response,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +capital_gains_carried_interest,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +capital_gains_residential_property,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +carers_allowance_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +child_benefit_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +child_tax_credit_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +childcare_expenses,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +clothing_and_footwear_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +communication_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +corporate_wealth,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +diesel_spending,1.0,1.13844,1.569717,1.539242,1.589317,1.539688,1.507377,1.459781,1.414994,1.35456,1.283802,1.283802,1.283802,1.283802,1.283802 +dividend_income,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +domestic_rates,1.0,1.0066,1.019887,1.08414,1.137371,1.191283,1.242865,1.296681,1.352828,1.411405,1.472519,1.536279,1.6028,1.672201,1.744607 +education_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +employee_pension_contributions,1.0,1.059,1.124023,1.193937,1.254828,1.321333,1.366259,1.399049,1.428429,1.459854,1.494891,1.544521,1.601823,1.661731,1.724379 +employer_pension_contributions,1.0,1.059,1.124023,1.193937,1.254828,1.321333,1.366259,1.399049,1.428429,1.459854,1.494891,1.544521,1.601823,1.661731,1.724379 +employment_income,1.0,1.059,1.124023,1.193937,1.254828,1.321333,1.366259,1.399049,1.428429,1.459854,1.494891,1.544521,1.601823,1.661731,1.724379 +employment_income_before_lsr,1.0,1.059,1.124023,1.193937,1.254828,1.321333,1.366259,1.399049,1.428429,1.459854,1.494891,1.544521,1.601823,1.661731,1.724379 +esa_contrib_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +esa_income_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +food_and_non_alcoholic_beverages_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +free_school_fruit_veg,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +free_school_meals,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +free_school_milk,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +gross_financial_wealth,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +health_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +household_furnishings_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +household_lifetime_isa_balance,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 household_weight,1.0,1.0,1.003,1.017,1.027,1.039,1.046,1.054,1.058,1.064,1.064,1.064,1.064,1.064,1.064 -housing_benefit_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -housing_service_charges,1.0,1.0,1.0,1.064,1.137,1.191,1.235,1.262,1.289,1.318,1.318,1.318,1.318,1.318,1.318 -housing_water_and_electricity_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -iidb_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -incapacity_benefit_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -income_support_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -jsa_contrib_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -jsa_income_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -lump_sum_income,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -main_residence_value,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -maintenance_expenses,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -maintenance_income,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -maternity_allowance_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -miscellaneous_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -miscellaneous_income,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -mortgage_capital_repayment,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -mortgage_interest_repayment,1.0,1.0,1.262,1.874,2.288,2.599,2.927,3.167,3.3,3.455,3.455,3.455,3.455,3.455,3.455 -net_financial_wealth,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -non_residential_property_value,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -other_investment_income,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -other_residential_property_value,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -owned_land,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -pension_credit_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -pension_credit_reported_capital,1.0,1.0,1.102,1.161,1.204,1.256,1.293,1.335,1.376,1.417,1.462,1.508,1.555,1.604,1.655 -pension_income,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -personal_pension_contributions,1.0,1.059,1.127,1.205,1.261,1.308,1.337,1.365,1.396,1.431,1.431,1.431,1.431,1.431,1.431 -petrol_spending,1.0,1.104,1.635,1.796,1.531,1.483,1.452,1.406,1.363,1.305,1.237,1.237,1.237,1.237,1.237 -private_pension_income,1.0,1.003,1.053,1.106,1.161,1.216,1.261,1.288,1.315,1.346,1.346,1.346,1.346,1.346,1.346 -private_transfer_income,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -property_income,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -recreation_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -restaurants_and_hotels_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -savings,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -savings_interest_income,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -sda_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -self_employment_income,1.0,1.0,1.063,1.089,1.141,1.194,1.231,1.27,1.315,1.365,1.365,1.365,1.365,1.365,1.365 -state_pension,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -state_pension_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -statutory_maternity_pay,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -statutory_paternity_pay,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -statutory_sick_pay,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -student_loan_repayments,1.0,1.059,1.127,1.205,1.261,1.308,1.337,1.365,1.396,1.431,1.431,1.431,1.431,1.431,1.431 -sublet_income,1.0,1.0,1.092,1.147,1.19,1.223,1.258,1.297,1.34,1.384,1.384,1.384,1.384,1.384,1.384 -transport_consumption,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -universal_credit_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -water_and_sewerage_charges,1.0,1.0,1.0,1.092,1.14,1.21,1.283,1.349,1.4,1.46,1.46,1.46,1.46,1.46,1.46 -winter_fuel_allowance_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 -working_tax_credit_reported,1.0,1.04,1.144,1.209,1.237,1.277,1.301,1.327,1.353,1.38,1.38,1.38,1.38,1.38,1.38 +housing_benefit_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +housing_water_and_electricity_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +iidb_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +incapacity_benefit_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +income_support_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +jsa_contrib_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +jsa_income_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +lifetime_isa_balance,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +lump_sum_income,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +main_residence_value,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +maintenance_expenses,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +maintenance_income,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +maternity_allowance_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +miscellaneous_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +miscellaneous_income,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +mortgage_capital_repayment,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +mortgage_interest_repayment,1.0,0.9774,1.120296,1.705538,2.17115,2.377844,2.567358,2.834363,2.969279,3.108241,3.280127,3.461518,3.65294,3.854948,4.068126 +net_financial_wealth,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +non_residential_property_value,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +other_investment_income,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +other_residential_property_value,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +owned_land,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +pension_credit_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +pension_credit_reported_capital,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +pension_income,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +personal_pension_contributions,1.0,1.059,1.124023,1.193937,1.254828,1.321333,1.366259,1.399049,1.428429,1.459854,1.494891,1.544521,1.601823,1.661731,1.724379 +petrol_spending,1.0,1.104066,1.63457,1.795584,1.530966,1.483159,1.452034,1.406186,1.363043,1.304828,1.236668,1.236668,1.236668,1.236668,1.236668 +private_pension_income,1.0,1.003,1.05315,1.105808,1.161098,1.202781,1.252095,1.29091,1.329638,1.366867,1.406507,1.438856,1.47195,1.506835,1.542698 +private_pension_wealth,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +private_transfer_income,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +property_income,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +recreation_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +restaurants_and_hotels_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +savings,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +savings_interest_income,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +sda_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +self_employment_income,1.0,1.0635,1.09498,1.08841,1.118123,1.125838,1.160289,1.203336,1.247137,1.291161,1.337772,1.386066,1.436103,1.487946,1.541661 +state_pension,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +state_pension_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +statutory_maternity_pay,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +statutory_paternity_pay,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +statutory_sick_pay,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +student_loan_repayments,1.0,1.059,1.124023,1.193937,1.254828,1.321333,1.366259,1.399049,1.428429,1.459854,1.494891,1.544521,1.601823,1.661731,1.724379 +sublet_income,1.0,1.0892,1.200189,1.26404,1.311062,1.368486,1.408446,1.453939,1.499011,1.543382,1.591998,1.642146,1.693874,1.747231,1.802269 +transport_consumption,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +universal_credit_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +winter_fuel_allowance_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 +working_tax_credit_reported,1.0,1.04,1.134328,1.217134,1.247562,1.289979,1.319649,1.346042,1.372963,1.400422,1.42843,1.456999,1.486139,1.515862,1.546179 diff --git a/policyengine_uk_data/storage/uprating_growth_factors.csv b/policyengine_uk_data/storage/uprating_growth_factors.csv index 956f740d..6f947d47 100644 --- a/policyengine_uk_data/storage/uprating_growth_factors.csv +++ b/policyengine_uk_data/storage/uprating_growth_factors.csv @@ -1,81 +1,85 @@ Variable,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034 -afcs_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -alcohol_and_tobacco_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -benunit_rent,0,0.0,0.0,0.11,0.067,0.033,0.043,0.029,0.03,0.03,0.0,0.0,0.0,0.0,0.0 -bsp_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -capital_gains,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -capital_gains_before_response,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -carers_allowance_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -child_benefit_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -child_tax_credit_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -childcare_expenses,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -clothing_and_footwear_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -communication_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -corporate_wealth,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -diesel_spending,0,0.138,0.379,-0.019,0.033,-0.031,-0.021,-0.032,-0.031,-0.043,-0.052,0.0,0.0,0.0,0.0 -dividend_income,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -domestic_energy_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -education_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -employee_pension_contributions,0,0.059,0.064,0.069,0.046,0.037,0.022,0.021,0.023,0.025,0.0,0.0,0.0,0.0,0.0 -employer_pension_contributions,0,0.059,0.064,0.069,0.046,0.037,0.022,0.021,0.023,0.025,0.0,0.0,0.0,0.0,0.0 -pension_contributions_via_salary_sacrifice,0,0.059,0.064,0.069,0.046,0.037,0.022,0.021,0.023,0.025,0.0,0.0,0.0,0.0,0.0 -employment_income,0,0.059,0.064,0.069,0.046,0.037,0.022,0.021,0.023,0.025,0.0,0.0,0.0,0.0,0.0 -employment_income_before_lsr,0,0.059,0.064,0.069,0.046,0.037,0.022,0.021,0.023,0.025,0.0,0.0,0.0,0.0,0.0 -esa_contrib_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -esa_income_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -food_and_non_alcoholic_beverages_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -free_school_fruit_veg,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -free_school_meals,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -free_school_milk,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -gross_financial_wealth,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -health_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -household_furnishings_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -household_weight,0,0.0,0.003,0.014,0.01,0.012,0.007,0.008,0.004,0.006,0.0,0.0,0.0,0.0,0.0 -housing_benefit_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -housing_service_charges,0,0.0,0.0,0.064,0.069,0.047,0.037,0.022,0.021,0.022,0.0,0.0,0.0,0.0,0.0 -housing_water_and_electricity_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -iidb_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -incapacity_benefit_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -income_support_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -jsa_contrib_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -jsa_income_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -lump_sum_income,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -main_residence_value,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -maintenance_expenses,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -maintenance_income,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -maternity_allowance_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -miscellaneous_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -miscellaneous_income,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -mortgage_capital_repayment,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -mortgage_interest_repayment,0,0.0,0.262,0.485,0.221,0.136,0.126,0.082,0.042,0.047,0.0,0.0,0.0,0.0,0.0 -net_financial_wealth,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -non_residential_property_value,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -other_investment_income,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -other_residential_property_value,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -owned_land,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -pension_credit_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -pension_credit_reported_capital,0,0.0,0.102,0.054,0.037,0.043,0.029,0.032,0.031,0.03,0.032,0.031,0.031,0.032,0.032 -pension_income,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -personal_pension_contributions,0,0.059,0.064,0.069,0.046,0.037,0.022,0.021,0.023,0.025,0.0,0.0,0.0,0.0,0.0 -petrol_spending,0,0.104,0.481,0.099,-0.147,-0.031,-0.021,-0.032,-0.031,-0.043,-0.052,0.0,0.0,0.0,0.0 -private_pension_income,0,0.003,0.05,0.05,0.05,0.047,0.037,0.021,0.021,0.024,0.0,0.0,0.0,0.0,0.0 -private_transfer_income,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -property_income,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -recreation_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -restaurants_and_hotels_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -savings,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -savings_interest_income,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -sda_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -self_employment_income,0,0.0,0.063,0.024,0.048,0.046,0.031,0.032,0.035,0.038,0.0,0.0,0.0,0.0,0.0 -state_pension,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -state_pension_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -statutory_maternity_pay,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -statutory_paternity_pay,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -statutory_sick_pay,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -student_loan_repayments,0,0.059,0.064,0.069,0.046,0.037,0.022,0.021,0.023,0.025,0.0,0.0,0.0,0.0,0.0 -sublet_income,0,0.0,0.092,0.05,0.037,0.028,0.029,0.031,0.033,0.033,0.0,0.0,0.0,0.0,0.0 -transport_consumption,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -universal_credit_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -water_and_sewerage_charges,0,0.0,0.0,0.092,0.044,0.061,0.06,0.051,0.038,0.043,0.0,0.0,0.0,0.0,0.0 -winter_fuel_allowance_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 -working_tax_credit_reported,0,0.04,0.1,0.057,0.023,0.032,0.019,0.02,0.02,0.02,0.0,0.0,0.0,0.0,0.0 +afcs_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +alcohol_and_tobacco_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +bsp_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +bus_fare_spending,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +bus_fare_spending_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +capital_gains,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +capital_gains_badr,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +capital_gains_before_response,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +capital_gains_carried_interest,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +capital_gains_residential_property,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +carers_allowance_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +child_benefit_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +child_tax_credit_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +childcare_expenses,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +clothing_and_footwear_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +communication_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +corporate_wealth,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +diesel_spending,0,0.13844,0.378832,-0.019414,0.032532,-0.031227,-0.020985,-0.031575,-0.030681,-0.04271,-0.052237,0.0,0.0,0.0,0.0 +dividend_income,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +domestic_rates,0,0.0066,0.0132,0.063,0.0491,0.047401,0.0433,0.0433,0.043301,0.0433,0.0433,0.0433,0.0433,0.0433,0.0433 +education_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +employee_pension_contributions,0,0.059,0.0614,0.0622,0.051,0.052999,0.034001,0.024,0.021,0.022,0.024,0.0332,0.0371,0.0374,0.0377 +employer_pension_contributions,0,0.059,0.0614,0.0622,0.051,0.052999,0.034001,0.024,0.021,0.022,0.024,0.0332,0.0371,0.0374,0.0377 +employment_income,0,0.059,0.0614,0.0622,0.051,0.052999,0.034001,0.024,0.021,0.022,0.024,0.0332,0.0371,0.0374,0.0377 +employment_income_before_lsr,0,0.059,0.0614,0.0622,0.051,0.052999,0.034001,0.024,0.021,0.022,0.024,0.0332,0.0371,0.0374,0.0377 +esa_contrib_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +esa_income_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +food_and_non_alcoholic_beverages_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +free_school_fruit_veg,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +free_school_meals,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +free_school_milk,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +gross_financial_wealth,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +health_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +household_furnishings_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +household_lifetime_isa_balance,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +household_weight,0,0.0,0.003,0.013958,0.009833,0.011685,0.006737,0.007648,0.003795,0.005671,0.0,0.0,0.0,0.0,0.0 +housing_benefit_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +housing_water_and_electricity_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +iidb_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +incapacity_benefit_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +income_support_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +jsa_contrib_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +jsa_income_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +lifetime_isa_balance,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +lump_sum_income,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +main_residence_value,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +maintenance_expenses,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +maintenance_income,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +maternity_allowance_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +miscellaneous_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +miscellaneous_income,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +mortgage_capital_repayment,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +mortgage_interest_repayment,0,-0.0226,0.1462,0.522399,0.273,0.0952,0.0797,0.104,0.0476,0.0468,0.0553,0.0553,0.0553,0.0553,0.0553 +net_financial_wealth,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +non_residential_property_value,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +other_investment_income,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +other_residential_property_value,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +owned_land,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +pension_credit_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +pension_credit_reported_capital,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +pension_income,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +personal_pension_contributions,0,0.059,0.0614,0.0622,0.051,0.052999,0.034001,0.024,0.021,0.022,0.024,0.0332,0.0371,0.0374,0.0377 +petrol_spending,0,0.104066,0.4805,0.098505,-0.147372,-0.031227,-0.020986,-0.031575,-0.030681,-0.04271,-0.052237,0.0,0.0,0.0,0.0 +private_pension_income,0,0.003,0.05,0.05,0.05,0.0359,0.041,0.031,0.030001,0.027999,0.029001,0.023,0.023,0.0237,0.0238 +private_pension_wealth,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +private_transfer_income,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +property_income,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +recreation_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +restaurants_and_hotels_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +savings,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +savings_interest_income,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +sda_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +self_employment_income,0,0.0635,0.0296,-0.006,0.027299,0.0069,0.0306,0.0371,0.0364,0.0353,0.0361,0.0361,0.0361,0.0361,0.0361 +state_pension,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +state_pension_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +statutory_maternity_pay,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +statutory_paternity_pay,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +statutory_sick_pay,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +student_loan_repayments,0,0.059,0.0614,0.0622,0.051,0.052999,0.034001,0.024,0.021,0.022,0.024,0.0332,0.0371,0.0374,0.0377 +sublet_income,0,0.0892,0.1019,0.053201,0.0372,0.0438,0.0292,0.0323,0.031,0.0296,0.0315,0.0315,0.0315,0.0315,0.0315 +transport_consumption,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +universal_credit_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +winter_fuel_allowance_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 +working_tax_credit_reported,0,0.04,0.0907,0.073,0.025,0.034,0.023,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02 diff --git a/policyengine_uk_data/targets/compute/income.py b/policyengine_uk_data/targets/compute/income.py index 19c49ac7..b522504e 100644 --- a/policyengine_uk_data/targets/compute/income.py +++ b/policyengine_uk_data/targets/compute/income.py @@ -1,8 +1,6 @@ """Income and salary sacrifice compute functions.""" import numpy as np -import pandas as pd -from policyengine_uk_data.storage import STORAGE_FOLDER def compute_income_band(target, ctx) -> np.ndarray: @@ -96,27 +94,21 @@ def compute_ss_ni_relief(target, ctx) -> np.ndarray: def compute_ss_headcount(target, ctx) -> np.ndarray: """Compute salary sacrifice user headcounts. - The 2k cap is defined at 2023-24 FRS base-year prices. The dataset - is uprated to 2025 for calibration then downrated to 2023 for - saving, but PE does not uprate SS when loading. To keep the - above/below classification consistent, deflate SS to base-year - prices before applying the threshold. + The 2k cap is applied to the contributions the calibration-year + simulation holds. uprating_factors.csv follows policyengine-uk's + load-time uprating, so these are the amounts the model runs on in that + year (the survey amounts, as policyengine-uk does not uprate this + variable at load), the values test_salary_sacrifice_headcount checks. """ ss = ctx.sim.calculate("pension_contributions_via_salary_sacrifice") - uprating = pd.read_csv(STORAGE_FOLDER / "uprating_factors.csv").set_index( - "Variable" - ) - row = "pension_contributions_via_salary_sacrifice" - price_adj = uprating.loc[row, "2023"] / uprating.loc[row, str(ctx.time_period)] - ss_base = ss * price_adj name = target.name if "below_cap" in name: - mask = (ss_base > 0) & (ss_base <= 2000) + mask = (ss > 0) & (ss <= 2000) elif "above_cap" in name: - mask = ss_base > 2000 + mask = ss > 2000 else: - mask = ss_base > 0 + mask = ss > 0 return ctx.household_from_person(mask) diff --git a/policyengine_uk_data/tests/test_income_projection.py b/policyengine_uk_data/tests/test_income_projection.py index 686604e0..6370578c 100644 --- a/policyengine_uk_data/tests/test_income_projection.py +++ b/policyengine_uk_data/tests/test_income_projection.py @@ -143,3 +143,12 @@ def test_projection_keeps_top_open_ended_band(projections): ] assert len(top_band) == 1 assert top_band.iloc[0]["dividend_income_amount"] > 0 + + +def test_projection_is_the_spi_table_uprated_with_the_committed_table( + projections, base_targets +): + """Regenerate incomes_projection.csv whenever uprating_factors.csv changes.""" + from policyengine_uk_data.utils.incomes_projection import project_income_table + + pd.testing.assert_frame_equal(project_income_table(base_targets), projections) diff --git a/policyengine_uk_data/tests/test_pension_credit_reported_capital.py b/policyengine_uk_data/tests/test_pension_credit_reported_capital.py index d1918581..dcdbfe16 100644 --- a/policyengine_uk_data/tests/test_pension_credit_reported_capital.py +++ b/policyengine_uk_data/tests/test_pension_credit_reported_capital.py @@ -9,6 +9,9 @@ applies. 3. Without either column every benefit unit gets -1. 4. The output is always -1 or a non-negative number, one per benefit unit. + +Uprating is checked against the engine for every row, including this +column, in test_uprating_factors_table.py. """ import numpy as np @@ -70,34 +73,6 @@ def test_output_is_sentinel_or_non_negative_for_random_inputs(): assert np.all(result[~keep] == -1) -def test_uprating_rows_match_the_model(): - """The build uprates the column with these rows (calibration materialises - the calibration year from them), and policyengine-uk projects the saved - dataset with the variable's own uprating index at runtime. The rows must - equal what ``create_policyengine_uprating_factors_table`` derives from the - locked policyengine-uk, or a unit near the 10,000 pound deemed-income - disregard can be assessed differently in calibration and at runtime.""" - from policyengine_uk.system import system - - from policyengine_uk_data.storage import STORAGE_FOLDER - from policyengine_uk_data.utils.uprating import END_YEAR, START_YEAR - - variable = system.variables["pension_credit_reported_capital"] - index = system.parameters.get_child(variable.uprating) - years = range(START_YEAR, END_YEAR + 1) - expected = {y: round(index(y) / index(START_YEAR), 3) for y in years} - factors = pd.read_csv(STORAGE_FOLDER / "uprating_factors.csv").set_index("Variable") - growth = pd.read_csv(STORAGE_FOLDER / "uprating_growth_factors.csv").set_index( - "Variable" - ) - for y in years: - assert factors.loc["pension_credit_reported_capital", str(y)] == expected[y] - expected_growth = ( - 0 if y == START_YEAR else round(expected[y] / expected[y - 1] - 1, 3) - ) - assert growth.loc["pension_credit_reported_capital", str(y)] == expected_growth - - def test_spi_copy_records_no_capital(): """SPI-synthetic copies carry SPI-imputed incomes, so the FRS donor's capital is cleared to -1 (household proxy) on them.""" diff --git a/policyengine_uk_data/tests/test_road_fuel_volume_uprating.py b/policyengine_uk_data/tests/test_road_fuel_volume_uprating.py index e44a1ade..77cf0f22 100644 --- a/policyengine_uk_data/tests/test_road_fuel_volume_uprating.py +++ b/policyengine_uk_data/tests/test_road_fuel_volume_uprating.py @@ -32,6 +32,7 @@ END_YEAR, HOUSEHOLD_WEIGHT_UPRATING_INDEX, START_YEAR, + UPRATING_TABLE_DECIMALS, VOLUME_OVERRIDDEN_VARIABLES, _apply_household_weight_uprating_override, _apply_road_fuel_litre_proxy_override, @@ -109,7 +110,9 @@ def test__given_uprating_table__then_only_fuel_rows_are_overridden(): household_weight_index=df.loc["household_weight"], ) for year in range(START_YEAR, END_YEAR + 1): - assert out.loc[variable, year] == round(expected[year], 3) + assert out.loc[variable, year] == round( + expected[year], UPRATING_TABLE_DECIMALS + ) def test__given_generated_uprating_table__then_household_weight_row_is_restored(): @@ -144,7 +147,9 @@ def test__given_storage_csv__then_fuel_rows_reflect_litre_proxy_index(): ) assert variable in df.index for year in range(START_YEAR, END_YEAR + 1): - assert df.loc[variable, str(year)] == round(expected[year], 3) + assert df.loc[variable, str(year)] == round( + expected[year], UPRATING_TABLE_DECIMALS + ) def test__given_storage_csv__then_household_weight_row_is_unchanged(): diff --git a/policyengine_uk_data/tests/test_salary_sacrifice_headcount.py b/policyengine_uk_data/tests/test_salary_sacrifice_headcount.py index 17a18a42..4f45fa60 100644 --- a/policyengine_uk_data/tests/test_salary_sacrifice_headcount.py +++ b/policyengine_uk_data/tests/test_salary_sacrifice_headcount.py @@ -6,8 +6,14 @@ """ import os +from types import SimpleNamespace + +import numpy as np +import pandas as pd from policyengine_uk_data.datasets.frs_release import CURRENT_FRS_RELEASE +from policyengine_uk_data.storage import STORAGE_FOLDER +from policyengine_uk_data.targets.compute.income import compute_ss_headcount REDUCED_BUILD = os.environ.get("TESTING") == "1" # The 32-epoch reduced build stops well short of the OBR salary-sacrifice @@ -90,3 +96,53 @@ def test_salary_sacrifice_above_cap_users(baseline): f"Expected ~{TARGET / 1e6:.1f}mn above-cap SS users, " f"got {total_above_cap / 1e6:.1f}mn ({total_above_cap / TARGET * 100:.0f}% of target)" ) + + +def _headcount_masks(contributions): + """Run compute_ss_headcount for each target on one person per household.""" + contributions = np.asarray(contributions, dtype=float) + ctx = SimpleNamespace( + sim=SimpleNamespace(calculate=lambda variable: contributions), + household_from_person=lambda values: np.asarray(values), + time_period=PERIOD, + ) + return { + kind: compute_ss_headcount( + SimpleNamespace(name=f"obr/salary_sacrifice_users_{kind}"), ctx + ) + for kind in ("total", "below_cap", "above_cap") + } + + +def test_headcount_targets_split_users_at_the_cap_on_simulated_amounts(): + """Calibration classifies the amounts the calibration-year simulation holds. + + The same amounts the tests above classify, with no adjustment through the + uprating table (which has no salary sacrifice row, as policyengine-uk does + not uprate it at load). Below and above the cap partition the users. + """ + edges = [0.0, 0.01, 1_999.99, 2_000.0, 2_000.01, 1e6] + rng = np.random.default_rng(0) + for contributions in (edges, rng.uniform(0, 5_000, 1_000)): + masks = _headcount_masks(contributions) + contributions = np.asarray(contributions) + np.testing.assert_array_equal( + masks["below_cap"], (contributions > 0) & (contributions <= 2_000) + ) + np.testing.assert_array_equal(masks["above_cap"], contributions > 2_000) + np.testing.assert_array_equal( + masks["below_cap"].astype(int) + masks["above_cap"], masks["total"] + ) + + +def test_calibration_year_contributions_are_the_survey_amounts(): + """The cap split classifies survey-year contributions only while + policyengine-uk carries them unchanged at load, so the table has no row. + + If policyengine-uk starts uprating them (policyengine-uk#1863), the + regenerated table gains a row and the split moves to nominal + calibration-year amounts. Decide then which of the two the headcount + targets should classify (policyengine-uk-data#541). + """ + table = pd.read_csv(STORAGE_FOLDER / "uprating_factors.csv", index_col="Variable") + assert "pension_contributions_via_salary_sacrifice" not in table.index diff --git a/policyengine_uk_data/tests/test_uprating_factors_table.py b/policyengine_uk_data/tests/test_uprating_factors_table.py new file mode 100644 index 00000000..c10d44cc --- /dev/null +++ b/policyengine_uk_data/tests/test_uprating_factors_table.py @@ -0,0 +1,276 @@ +"""uprating_factors.csv follows policyengine-uk's load-time uprating. + +``uprate_dataset`` moves the build between the FRS base year and the +calibration year with this table, and policyengine-uk moves the saved file +to later years with ``extend_single_year_dataset``. Calibrated values are the +values the model runs on only where the two agree. + +Invariants, checked for every row and every year (or pair of years): +- the committed table is what the generator builds from the locked + policyengine-uk, and its rows are exactly the variables policyengine-uk + uprates at load; +- outside ``OVERRIDDEN_VARIABLES`` each row grows each year by one plus the + growth parameter policyengine-uk applies to it, and agrees with + policyengine-uk's own ``extend_single_year_dataset`` (differential), as + does ``uprate_dataset`` from the FRS base year; +- the fuel rows divide by the household-weight override, so fuel spending + times household weight stays on policyengine-uk's path; +- every row is a level index (1 in ``START_YEAR``, finite, above 0.5), so + ``uprate_dataset`` there and back between any two years is the identity; +- every variable a target projection uprates has a row. + +The engine's other load-time changes are outside the table: council tax by +country, rent by region and tenure, and student loan plan reassignment, which +zeroes the repayments of loans it writes off. + +test_income_projection checks that incomes_projection.csv is the committed +SPI table projected with this table. +""" + +import numpy as np +import pandas as pd +import pytest +from policyengine_uk.data import UKSingleYearDataset + +from policyengine_uk_data.datasets.frs_release import CURRENT_FRS_RELEASE +from policyengine_uk_data.storage import STORAGE_FOLDER +from policyengine_uk_data.utils import uprating +from policyengine_uk_data.utils.uprating import ( + END_YEAR, + OVERRIDDEN_VARIABLES, + START_YEAR, + UPRATING_TABLE_DECIMALS, + VOLUME_OVERRIDDEN_VARIABLES, + build_uprating_factors_table, + policyengine_uk_load_time_index, + policyengine_uk_uprating_indices, + uprate_dataset, +) + +TABLE = pd.read_csv(STORAGE_FOLDER / "uprating_factors.csv", index_col="Variable") +TABLE.columns = TABLE.columns.astype(int) +YEARS = list(range(START_YEAR, END_YEAR + 1)) +ENGINE_ROWS = TABLE.index.difference(OVERRIDDEN_VARIABLES) +# Each stored level is within half a unit in the last stored place of the +# unrounded level, and every level exceeds 0.5, so a ratio of two stored +# levels is within 2 units in that place, relative, of the unrounded ratio. +ROUNDING = 2 * 10**-UPRATING_TABLE_DECIMALS +# The engine's own uprating moves council tax by country and rent by region +# and tenure. Neither is a single index, so neither is in the table and +# `uprate_dataset` leaves both unchanged. +NOT_SINGLE_INDICES = ("council_tax", "rent") +# Dataset columns that declare an `uprating` attribute policyengine-uk does not +# apply at load (policyengine-uk#1862): both paths carry them unchanged. +CARRIED_UNCHANGED = ( + "housing_service_charges", + "pension_contributions_via_salary_sacrifice", + "rail_usage", + "water_and_sewerage_charges", +) + + +def _unit_dataset(variables, year: int) -> UKSingleYearDataset: + """One person, benefit unit and household with every variable at 1.""" + from policyengine_uk.system import system + + tables = { + "person": { + "person_id": [1], + "person_benunit_id": [1], + "person_household_id": [1], + }, + "benunit": {"benunit_id": [1]}, + "household": { + "household_id": [1], + "region": ["LONDON"], + "tenure_type": ["RENT_PRIVATELY"], + **{variable: [1.0] for variable in NOT_SINGLE_INDICES}, + }, + } + for variable in variables: + tables[system.variables[variable].entity.key][variable] = [1.0] + return UKSingleYearDataset( + **{name: pd.DataFrame(columns) for name, columns in tables.items()}, + fiscal_year=year, + ) + + +def _value(dataset: UKSingleYearDataset, variable: str) -> float: + (column,) = [table[variable] for table in dataset.tables if variable in table] + return float(column.iloc[0]) + + +def _project_with_policyengine_uk(dataset, end_year: int) -> dict: + from policyengine_uk.data.economic_assumptions import extend_single_year_dataset + from policyengine_uk.system import system + + return extend_single_year_dataset( + dataset, system.parameters, end_year=end_year + ).datasets + + +def test_committed_table_is_what_the_generator_builds(): + """Fails when policyengine-uk's growth parameters or indices change. + + Regenerate with ``python -m policyengine_uk_data.utils.uprating``, then + ``python -m policyengine_uk_data.utils.incomes_projection``. + """ + pd.testing.assert_frame_equal( + TABLE, build_uprating_factors_table(), check_names=False, rtol=0, atol=1e-12 + ) + + +def test_rows_are_the_variables_policyengine_uk_uprates_at_load(): + engine = policyengine_uk_load_time_index() + assert set(TABLE.index) == set(engine.index) + assert set(OVERRIDDEN_VARIABLES) <= set(TABLE.index) + + +def test_each_row_grows_by_its_policyengine_uk_growth_parameter(): + from policyengine_uk.system import system + + for index_name, variables in policyengine_uk_uprating_indices().items(): + growth = system.parameters.get_child(index_name) + for variable in set(variables).difference(OVERRIDDEN_VARIABLES): + for year in YEARS[1:]: + factor = TABLE.loc[variable, year] / TABLE.loc[variable, year - 1] + assert factor == pytest.approx(1 + growth(str(year)), rel=ROUNDING), ( + variable, + year, + ) + + +def test_table_agrees_with_policyengine_uks_own_load_time_uprating(): + """Differential: policyengine-uk projects a dataset of ones from START_YEAR.""" + projected = _project_with_policyengine_uk( + _unit_dataset(TABLE.index, START_YEAR), END_YEAR + ) + for year in YEARS: + engine = projected[year] + for variable in ENGINE_ROWS: + assert TABLE.loc[variable, year] == pytest.approx( + _value(engine, variable), rel=ROUNDING + ), (variable, year) + engine_weight = _value(engine, "household_weight") + for variable in VOLUME_OVERRIDDEN_VARIABLES: + weighted = TABLE.loc[variable, year] * TABLE.loc["household_weight", year] + assert weighted == pytest.approx( + _value(engine, variable) * engine_weight, rel=ROUNDING + ), (variable, year) + + +@pytest.mark.parametrize("year", range(CURRENT_FRS_RELEASE.base_year, 2031)) +def test_uprate_dataset_from_the_base_year_matches_policyengine_uk(year): + """What calibration sees in ``year`` is what policyengine-uk runs on. + + policyengine-uk projects a dataset to 2030 at load, so later years follow + each variable's own ``uprating`` attribute and are not compared. + """ + base_year = CURRENT_FRS_RELEASE.base_year + variables = list(TABLE.index) + list(CARRIED_UNCHANGED) + dataset = _unit_dataset(variables, base_year) + engine = _project_with_policyengine_uk(dataset, year)[year] + calibration = uprate_dataset(dataset, year) + for variable in ENGINE_ROWS.union(CARRIED_UNCHANGED): + assert _value(calibration, variable) == pytest.approx( + _value(engine, variable), rel=ROUNDING + ), variable + for variable in CARRIED_UNCHANGED: + assert _value(calibration, variable) == 1.0, variable + for variable in VOLUME_OVERRIDDEN_VARIABLES: + assert _value(calibration, variable) * _value( + calibration, "household_weight" + ) == pytest.approx( + _value(engine, variable) * _value(engine, "household_weight"), + rel=ROUNDING, + ), variable + + +def test_student_loan_plan_reassignment_is_outside_the_table(): + """The table grows repayments by average earnings, as the engine does for a + loan it keeps. It does not zero a loan the engine writes off at load.""" + base_year = CURRENT_FRS_RELEASE.base_year + year = base_year + 1 + dataset = UKSingleYearDataset( + person=pd.DataFrame( + { + "person_id": [1, 2], + "person_benunit_id": [1, 2], + "person_household_id": [1, 1], + # Ages are carried unchanged, so in `year` these borrowers + # started university in 2012 (Plan 2) and 1982 (written off). + "age": [year - 2012 + 18.0, year - 1982 + 18.0], + "student_loan_plan": ["PLAN_2", "PLAN_1"], + "highest_education": ["TERTIARY", "TERTIARY"], + "student_loan_repayments": [1.0, 1.0], + } + ), + benunit=pd.DataFrame({"benunit_id": [1, 2]}), + household=pd.DataFrame( + { + "household_id": [1], + "region": ["LONDON"], + "tenure_type": ["RENT_PRIVATELY"], + **{variable: [1.0] for variable in NOT_SINGLE_INDICES}, + } + ), + fiscal_year=base_year, + ) + engine = _project_with_policyengine_uk(dataset, year)[year].person + calibration = uprate_dataset(dataset, year).person + growth = ( + TABLE.loc["student_loan_repayments", year] + / TABLE.loc["student_loan_repayments", base_year] + ) + assert list(engine.student_loan_plan) == ["PLAN_2", "NONE"] + assert engine.student_loan_repayments.tolist() == [ + pytest.approx(growth, rel=ROUNDING), + 0, + ] + assert calibration.student_loan_repayments.tolist() == [ + pytest.approx(growth, rel=1e-15), + pytest.approx(growth, rel=1e-15), + ] + + +def test_every_row_is_a_level_index(): + levels = TABLE.to_numpy() + assert (TABLE[START_YEAR] == 1).all() + assert np.isfinite(levels).all() + assert (levels > 0.5).all() + + +@pytest.mark.parametrize("start", YEARS) +def test_uprate_dataset_there_and_back_is_the_identity(start): + dataset = _unit_dataset(TABLE.index, start) + for end in YEARS: + there = uprate_dataset(dataset, end) + back = uprate_dataset(there, start) + for variable in TABLE.index: + assert _value(there, variable) == pytest.approx( + TABLE.loc[variable, end] / TABLE.loc[variable, start], rel=1e-15 + ) + assert _value(back, variable) == pytest.approx(1.0, rel=1e-12) + + +def test_every_variable_a_target_projection_uprates_has_a_row(): + """A missing row loses targets: the CGT projection stops at the first year + it cannot uprate, behind a log warning, and the SPI income projection + cannot be regenerated.""" + from policyengine_uk_data.utils.incomes_projection import ALL_INCOME_VARIABLES + + needed = set(ALL_INCOME_VARIABLES) | {"household_weight", "capital_gains"} + assert needed <= set(TABLE.index), needed - set(TABLE.index) + + +def test_a_variable_listed_under_two_indices_raises(monkeypatch): + monkeypatch.setattr( + uprating, + "policyengine_uk_uprating_indices", + lambda: { + "gov.economic_assumptions.yoy_growth.obr.consumer_price_index": ["x"], + "gov.economic_assumptions.yoy_growth.obr.average_earnings": ["x"], + }, + ) + with pytest.raises(ValueError, match="listed under two indices"): + policyengine_uk_load_time_index() diff --git a/policyengine_uk_data/utils/uprating.py b/policyengine_uk_data/utils/uprating.py index ff3939fb..45826756 100644 --- a/policyengine_uk_data/utils/uprating.py +++ b/policyengine_uk_data/utils/uprating.py @@ -1,9 +1,15 @@ +from pathlib import Path + from policyengine_uk_data.storage import STORAGE_FOLDER import pandas as pd +import yaml from policyengine_uk.data import UKSingleYearDataset START_YEAR = 2020 END_YEAR = 2034 +# Decimal places stored in uprating_factors.csv. At 3 places the rounding +# alone moved the factor between two years by up to 0.08%. +UPRATING_TABLE_DECIMALS = 6 # These variables are named as spending, but PolicyEngine UK derives fuel # litres through ``litres = spending / price`` and uprates household weights @@ -31,6 +37,10 @@ 2033: 1.064, 2034: 1.064, } +# Rows of the table that deliberately differ from policyengine-uk's own +# index. The fuel rows divide by the household-weight row, so together they +# keep weighted fuel spending on the engine's path. +OVERRIDDEN_VARIABLES = ("household_weight",) + VOLUME_OVERRIDDEN_VARIABLES class UpratingYearOutOfRangeError(ValueError): @@ -55,32 +65,69 @@ def _check_year_in_range(year: int, *, kind: str) -> None: ) -def create_policyengine_uprating_factors_table(): - from policyengine_uk.system import system +def policyengine_uk_uprating_indices() -> dict[str, list[str]]: + """The growth index policyengine-uk projects each dataset variable by. - df = pd.DataFrame() + Read from the ``uprating_indices.yaml`` that + ``policyengine_uk.data.economic_assumptions`` loads: a mapping from a + year-on-year growth parameter to the variables it uprates. + """ + from policyengine_uk.data import economic_assumptions + + path = Path(economic_assumptions.__file__).with_name("uprating_indices.yaml") + with open(path) as f: + return yaml.safe_load(f) + + +def policyengine_uk_load_time_index( + start_year: int = START_YEAR, end_year: int = END_YEAR +) -> pd.DataFrame: + """Level index (``start_year`` = 1) that policyengine-uk applies to data. + + policyengine-uk projects a single-year dataset to later years with + ``economic_assumptions.extend_single_year_dataset`` (to 2030 by default): + each year, every variable listed in ``uprating_indices.yaml`` is + multiplied by one plus the year-on-year growth parameter it is listed + under. Variables the file does not list are carried forward unchanged, + and a variable's own ``uprating`` attribute only applies to periods with + no stored value (for a dataset column, after the last year the dataset is + projected to), so neither appears here; past that year this index keeps + compounding the same growth parameters. Council tax and rent, which the + engine uprates by country and by region and tenure, are not single + indices and are not covered, nor is the engine's yearly reassignment of + student loan plans, which zeroes the repayments of loans it writes off. + """ + from policyengine_uk.system import system - variable_names = [] - years = [] - index_values = [] + rows = {} + for index_name, variables in policyengine_uk_uprating_indices().items(): + growth = system.parameters.get_child(index_name) + level = [1.0] + for year in range(start_year + 1, end_year + 1): + level.append(level[-1] * (1 + growth(str(year)))) + for variable in variables: + if variable in rows: + raise ValueError( + f"{variable} is listed under two indices in " + "policyengine-uk's uprating_indices.yaml." + ) + rows[variable] = level + df = pd.DataFrame.from_dict( + rows, orient="index", columns=range(start_year, end_year + 1) + ) + df.index.name = "Variable" + return df.sort_index() - for variable in system.variables.values(): - if variable.uprating is not None: - parameter = system.parameters.get_child(variable.uprating) - start_value = parameter(START_YEAR) - for year in range(START_YEAR, END_YEAR + 1): - variable_names.append(variable.name) - years.append(year) - growth = parameter(year) / start_value - index_values.append(round(growth, 3)) - df["Variable"] = variable_names - df["Year"] = years - df["Value"] = index_values +def build_uprating_factors_table() -> pd.DataFrame: + """The uprating factor table: policyengine-uk's load-time index, overridden. - # Convert to there is a column for each year - df = df.pivot(index="Variable", columns="Year", values="Value") - df = df.sort_values("Variable") + ``uprate_dataset`` moves the build between the FRS base year and the + calibration year with this table, and policyengine-uk moves the saved file + with its own load-time index, so the two must agree for calibrated values + to be the values the model runs on. Only ``OVERRIDDEN_VARIABLES`` differ. + """ + df = policyengine_uk_load_time_index().round(UPRATING_TABLE_DECIMALS) # Keep the population calibration row stable. Current PolicyEngine UK # population indices would inflate final calibrated population above the @@ -90,14 +137,20 @@ def create_policyengine_uprating_factors_table(): # Ensure petrol/diesel use sourced road-fuel clearances and model pump # prices. This keeps litres aligned after PolicyEngine divides by price. df = _apply_road_fuel_litre_proxy_override(df) + return df + +def create_policyengine_uprating_factors_table(): + df = build_uprating_factors_table() df.to_csv(STORAGE_FOLDER / "uprating_factors.csv") # Create a table with growth factors by year df_growth = df.copy() for year in range(END_YEAR, START_YEAR, -1): - df_growth[year] = round(df_growth[year] / df_growth[year - 1] - 1, 3) + df_growth[year] = round( + df_growth[year] / df_growth[year - 1] - 1, UPRATING_TABLE_DECIMALS + ) df_growth[START_YEAR] = 0 df_growth.to_csv(STORAGE_FOLDER / "uprating_growth_factors.csv") @@ -224,7 +277,7 @@ def _apply_road_fuel_litre_proxy_override(df: pd.DataFrame) -> pd.DataFrame: + ", ".join(str(year) for year in missing_years) ) for year in range(START_YEAR, END_YEAR + 1): - df.loc[variable, year] = round(index[year], 3) + df.loc[variable, year] = round(index[year], UPRATING_TABLE_DECIMALS) return df diff --git a/uv.lock b/uv.lock index 5ae82135..dce9c828 100644 --- a/uv.lock +++ b/uv.lock @@ -1433,7 +1433,7 @@ wheels = [ [[package]] name = "policyengine-uk-data" -version = "1.57.4" +version = "1.58.0" source = { editable = "." } dependencies = [ { name = "google-auth" },