PolicyEngine / policyengine-us-data

A package to create representative microdata for PolicyEngine US.
https://policyengine.github.io/policyengine-us-data/
1 stars 2 forks source link

Add passive/active partnership and S-corp variables from PUF #105

Open MaxGhenis opened 4 weeks ago

MaxGhenis commented 4 weeks ago

Currently map E26270 to partnership_s_corp_distributions, but PUF provides more detailed components we should use:

Partnership:

S-corporation:

Also:

Changes needed in puf.py:

  1. Add mappings for all passive/active components
  2. Add validation that components sum to E26270:

    # Partnership components
    partnership_total = (E25940 + E25980  # income
                       - E25920 - E25960) # losses
    # S-corp components
    scorp_total = (E26170 + E26190  # income
                  - E26160 - E26180) # losses
    
    assert np.allclose(E26270, partnership_total + scorp_total)
  3. Map E68000 to passive_losses_allowed
  4. Map F8582 to has_form_8582

This will enable proper passive loss limitation calculations in policyengine-us.