Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are two issues involved in the decreased tax as a result of state and local deduction haircut. We identified the first one, in regular cap gain function, as a bug and fixed it in this PR. The second one needs further confirmation from experiments.
The first part comes from an if-condition in TaxGain function. Previously, we only calculate cap gain for regular tax if taxable income (_taxinc) is positive. Otherwise we set it to zero. This will give many records a jump in cap gain after we apply the haircut, which will increase cap gain for AMT, decrease total AMT and ultimately reduce ospc tax. The commits in this PR removed this if-condition.
The second part of the issue might be resulted from improper design of IRS forms but needs more confirmation. Currently many people choose to itemize their deductions for regular tax because their could deduct more than standard deduction. But they might end up paying AMT, which adds back itemized deduction in the tax base, and get penalized for choosing this higher itemized deduction. In other words, they should have chosen standard deduction even it's smaller than itemized deduction, because standard deduction is not included in AMT base and these taxpayers would therefore have a lower tax liability. This might explain why many taxpayers have lower OSPC tax in the haircut scenario. Because of the haircut, they switched from itemized deduction to standard deduction, reduced their AMT tax base and ended up paying less tax. @MattHJensen is about to do more analysis on this group of tax payers to confirm our hypothesis.
Here're some useful ipython notebook commands for testing:
calc2.records.RECID[(calc2.records._ospctax-calc1.records._ospctax)<-0.01][:100]
calc2.records.c00100[calc2.records.RECID==12345]