Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPI model fixes #907

Merged
merged 34 commits into from
Jul 27, 2024
Merged

SPI model fixes #907

merged 34 commits into from
Jul 27, 2024

Conversation

anth-volk
Copy link
Collaborator

@anth-volk anth-volk commented Jul 18, 2024

Fixes #910
Fixes #901
Fixes #899
Fixes #911
Fixes #896

PR makes various changes to the UK country package to calibrate our output to the SPI 2020/21 dataset. It also ensures that we properly calculate Scottish income taxes.

@anth-volk
Copy link
Collaborator Author

Income tax error as of commit 36489be

<=10      74.696095
<1000     16.799956
<100       4.321959
>=1000     4.181990

@anth-volk
Copy link
Collaborator Author

Income tax error as of commit 1f9766c

<=10      76.810711
<1000     15.208277
<100       4.141281
>=1000     3.839731

@anth-volk
Copy link
Collaborator Author

As of commit 3944d41:

<=10      77.089142
<1000     14.974576
<100       4.146056
>=1000     3.790227

@anth-volk
Copy link
Collaborator Author

As of commit 3badd07:

<=10      77.282008
<1000     14.909617
<100       4.069412
>=1000     3.738964

@anth-volk
Copy link
Collaborator Author

Further testing seems to demonstrate that the SPI doesn't properly apply the Property Allowance. Without the allowance, as of our last commit, we had the following error rates:

<=10      77.353626
<1000     14.793143
<100       4.063255
>=1000     3.789976

If I set the Property Allowance to 0 within the parameters, the output jumps to:

<=10      83.907681
<1000      8.406449
<100       4.066396
>=1000     3.619475

This is supported by certain particular records, such as 630113, which has no employment income, a dividend income of £72,000, and a property income of £28,200, so we'd expect an adjusted net income of £99,200 (property allowance is calculated before all other allowances, and only on property), but SPI reports a TAXINC value of £100,200.

@anth-volk
Copy link
Collaborator Author

Note, too, that I tried various other approaches to fixing the property allowance issue, including changing where the property allowance was calculated, updating it and the dividend allowance parameter value, and checking to ensure that tax is assessed correctly on both types of income, but none of those were successful.

@anth-volk
Copy link
Collaborator Author

As of commit 1d6dc20:

<=10      84.148543
<1000      8.200767
<100       4.079463
>=1000     3.571227

@anth-volk
Copy link
Collaborator Author

As of commit 3660a06:

<=10      84.196289
<1000      8.156037
<100       4.081222
>=1000     3.566452

@anth-volk
Copy link
Collaborator Author

As of commit b18fffe:

<=10      85.897908
<1000      6.371240
<100       4.164777
>=1000     3.566075

@anth-volk
Copy link
Collaborator Author

As of commit a07861e:

<=10      87.994431
<1000      5.434049
<100       3.342928
>=1000     3.228591

@anth-volk
Copy link
Collaborator Author

As of commit fa70a97:

<=10      88.222981
<1000      5.449881
<100       3.340792
>=1000     2.986346

@anth-volk
Copy link
Collaborator Author

As of commit 47bb39c:

<=10      88.232530
<1000      5.448373
<100       3.335515
>=1000     2.983582

@anth-volk
Copy link
Collaborator Author

As of commit 2df0f27:

<=10      88.402905
<1000      5.363311
<100       3.297822
>=1000     2.935962

@anth-volk
Copy link
Collaborator Author

As of commit 4592b4b:

<=10      88.402905
<1000      5.363562
<100       3.297822
>=1000     2.935711

@anth-volk
Copy link
Collaborator Author

As of commit 255de32:

<=10      91.265491
<1000      5.586080
>=1000     1.999022
<100       1.149407

@anth-volk
Copy link
Collaborator Author

Final outcome:

<=10      91.265491
<1000      5.586080
>=1000     1.999022
<100       1.149407

@anth-volk anth-volk marked this pull request as ready for review July 26, 2024 20:39
@nikhilwoodruff nikhilwoodruff merged commit 3a36c59 into master Jul 27, 2024
3 checks passed
@nikhilwoodruff nikhilwoodruff deleted the fix/include_other_credits branch July 27, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment