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

Fix CDCC phase-out logic #2778

Closed
martinholmer opened this issue Jul 24, 2024 · 0 comments · Fixed by #2779
Closed

Fix CDCC phase-out logic #2778

martinholmer opened this issue Jul 24, 2024 · 0 comments · Fixed by #2779
Assignees
Labels

Comments

@martinholmer
Copy link
Collaborator

martinholmer commented Jul 24, 2024

Since March 2021 when PR #2573 was merged into the master branch, the CDCC phase-out calculations have not been correct. The problem stems from the introduction in PR #2573 of the CDCC_prt parameter, which is defined as the ratio of the rate phase-out per incremental step of AGI above the CDCC_ps AGI level (and, only in 2021, the CDCC_ps2) and the size of the incremental steps of excess AGI. Because the phase-out rate per step is 0.01 and the size of each step is 2000, the CDCC_prt parameter value was set to 0.01 / 2000, which is 5e-6.

The problem is that in the exact calculations, the number of phase-out steps is a stair-step function, with fractional steps rounded up to the next highest whole number of steps. That calculation was unable to be done correctly when there was only the compound CDCC_prt parameter.

The solution is to replace the CDCC_prt parameter with two new parameters: the CDCC_po_step_size parameter (which has a value of 2000) and the CDCC_po_rate_per_step parameter (which has a value of 0.01). Then the code will be able to apply correctly the ceiling function to the number of phase-out steps.

Here is a simple 2022 test case that illustrates the problem:

% cat case.csv      
RECID,MARS,age_head,age_spouse,n21,n1820,nu18,EIC,n24,nu13,f2441,nu06,e00200p,e00200s,e00200,e32800
29031,4,36,0,1,0,1,1,1,1,1,0,41750,0,41750,8000

samples% tc case.csv 2022 --exact --dump --dvars tc.ovars 
Tax-Calculator startup did not extrapolate your data.

samples% cat case-22-\#-\#-\#.csv
FLPDYR,RECID,c00100,c02500,c04800,c05800,c07180,c09200,ctc_refundable,ctc_total,eitc,iitax,payrolltax,ptax_amc,recovery_rebate_credit,refund
2022,29031,41750.00,0.00,22350.00,2389.00,600.00,0.00,211.00,2000.00,278.12,-489.12,6387.75,0.00,0.00,489.12

Notice that AGI is $41,750 and the calculated value of CDCC (c07180) is $600, which is incorrect; it should be $630. Also note that (41750 - 15000) / 2000 = 13.375, which rounds up to 14 steps. And that 0.35 - 14 * 0.01 = 0.21 (not 0.20). The difference between 0.21 and 0.20 causes the $30 CDCC difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant