PolicyEngine / policyengine-api

PolicyEngine's REST API for computing policy impacts.
GNU Affero General Public License v3.0
7 stars 19 forks source link

Calculate relative LSRs as % change in earnings, not change in earnings / market income #1542

Closed MaxGhenis closed 1 month ago

MaxGhenis commented 1 month ago

The _rel results currently equal change in earnings divided by market income. It should instead be change in earnings divided by baseline earnings.

See for instance: https://github.com/PolicyEngine/policyengine-api/blob/312da084ab3cc4aa5eaced1219bde79d913ede99/policyengine_api/endpoints/economy/compare.py#L42

anth-volk commented 1 month ago

Unfortunately, I've been working on this, but I'm unsure as to the desired approach. In any case where the baseline policy does not have labor elasticities applied, the baseline LSR outcome is an array of 0's, preventing division. However, if dividing against earnings, frankly, I'm not sure if I should be dividing against one of the following, as none is specifically referred to as "earnings," and I'd like to be sure:

Alternatively, is a different value required, necessitating changes to core?

MaxGhenis commented 1 month ago

There will be no divide-by-zero. We want to divide by total baseline earnings (~$10.9T total, positive in all deciles). Earnings = employment_income + self_employment_income