-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add renames and employer NI logic * Add employer NI logic * Bump version * Bump version * Fix employer cost logic for emp_income < threshold * Remove debugging line
- Loading branch information
1 parent
a6316bd
commit 660db83
Showing
26 changed files
with
492 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +0,0 @@ | ||
- bump: minor | ||
changes: | ||
fixed: | ||
- Set the Winter Fuel Allowance to only true in FY24-25. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from policyengine_uk import Simulation\n", | ||
"from policyengine_core.reforms import Reform\n", | ||
"\n", | ||
"Reform.from_dict({\n", | ||
" \"gov.hmrc.national_insurance.class_1.rates.employer\": {\n", | ||
" \"year:2025:10\": 0.148,\n", | ||
" },\n", | ||
"}\n", | ||
"\n", | ||
"sim = Simulation(reform=), situation={\n", | ||
" \"employment_income\": {\n", | ||
" 2025: 40_000,\n", | ||
" },\n", | ||
"})" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"array([37500.], dtype=float32)" | ||
] | ||
}, | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"sim.calculate(\"employment_income\", 2025)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "base", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.14" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Employer NI in PolicyEngine" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from policyengine_uk import Microsimulation" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"baseline = Microsimulation()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"0.0" | ||
] | ||
}, | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"baseline.calculate(\"employee_pension_contributions\").sum() / 1e9" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "base", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.14" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 58, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from policyengine_uk import Simulation\n", | ||
"from policyengine_core.reforms import Reform\n", | ||
"\n", | ||
"\n", | ||
"def get_employer_cost(employment_income, ni_rate, ni_threshold):\n", | ||
" return employment_income + ni_rate * (employment_income - ni_threshold)\n", | ||
" raise_emp_ni = Reform.from_dict(\n", | ||
" {\n", | ||
" \"gov.hmrc.national_insurance.class_1.rates.employer\": {\n", | ||
" \"2025-01-01.2030-01-01\": ni_rate\n", | ||
" },\n", | ||
" \"gov.hmrc.national_insurance.class_1.thresholds.secondary_threshold\": {\n", | ||
" \"2025-01-01.2030-01-01\": ni_threshold\n", | ||
" },\n", | ||
" }\n", | ||
" )\n", | ||
"\n", | ||
" raised_ni_simulation = Simulation(\n", | ||
" situation={\n", | ||
" \"employment_income\": employment_income,\n", | ||
" },\n", | ||
" reform=raise_emp_ni,\n", | ||
" )\n", | ||
"\n", | ||
" # return employment_income + raised_ni_simulation.calculate(\"ni_employer\", 2025)[0]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 71, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"45495.47096412556" | ||
] | ||
}, | ||
"execution_count": 71, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"from policyengine_uk.system import system\n", | ||
"\n", | ||
"parameters = system.parameters(2025).gov.hmrc.national_insurance\n", | ||
"\n", | ||
"RATE = parameters.class_1.rates.employer # 13.8%\n", | ||
"THRESHOLD = parameters.class_1.thresholds.secondary_threshold # 9100\n", | ||
"\n", | ||
"\n", | ||
"def get_new_i(cost, rate, threshold):\n", | ||
" return (cost + rate * threshold) / (1 + rate)\n", | ||
"\n", | ||
"\n", | ||
"baseline_emp_cost = get_employer_cost(40_000, RATE, THRESHOLD)\n", | ||
"baseline_emp_cost" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 72, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"39584.463443166314" | ||
] | ||
}, | ||
"execution_count": 72, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"new_i = get_new_i(baseline_emp_cost, 0.15, THRESHOLD)\n", | ||
"new_i" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 73, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"45495.47096412557" | ||
] | ||
}, | ||
"execution_count": 73, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"get_employer_cost(new_i, 0.15, THRESHOLD)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "base", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.14" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
1 change: 1 addition & 0 deletions
1
policyengine_uk/parameters/gov/contrib/policyengine/employer_ni/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Employer NI |
6 changes: 6 additions & 0 deletions
6
policyengine_uk/parameters/gov/contrib/policyengine/employer_ni/employee_incidence.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
description: Assume that employers keep employment costs constant in response to employer NI changes. | ||
values: | ||
2010-01-01: true | ||
metadata: | ||
label: Employer NI employee incidence | ||
unit: bool |
6 changes: 6 additions & 0 deletions
6
...arameters/gov/contrib/policyengine/employer_ni/exempt_employer_pension_contributions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
description: Whether to exempt employer pension contributions from employer NI. | ||
values: | ||
2010-01-01: true | ||
metadata: | ||
unit: bool | ||
label: exempt employer pension contributions from employers' NI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
policyengine_uk/parameters/gov/hmrc/pensions/pensions_programs.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.