EnergyInnovation / eps-us

Energy Policy Simulator - United States
GNU General Public License v3.0
22 stars 7 forks source link

Remove agricultural products for exported animal feed from calculations in indst\BSoAIGtAP #216

Closed robbieorvis closed 2 years ago

robbieorvis commented 2 years ago

Just a data update here: we should remove the calculation in the referenced variable feed that is used for animals that are exported. I made this edit in the uploaded file for China here, so it can be carried to the US (it's the same format database just copy and paste BAU Shr of Ag Indst Going to Anml Prdcts.xlsx )

jrissman commented 2 years ago

Say, Robbie/Megan, in the formulas for this sheet, for example in cell V5, should:

=IFERROR(IF($D9=" Feed",F9/F5*(F5-F8)/SUM(F8,F5),0),0)

be

=IFERROR(IF($D9=" Feed",F9/F5*(F5-F8)/F5,0),0)

That is, the "Production" row likely includes exports, which is why for animal products (like cell V133), the denominator is just F133 and not SUM(F133,F136). But the rows for non-animal products appear to be adding production and exports to get the denominator, which seems to be double-counting the exports in the denominator.

jrissman commented 2 years ago

Also you're getting some results above 1.0 (like in cell V21), which happens when large amounts of imports are used for feed. But we can't exceed 1.0 here because it's supposed to be the fraction of domestic agriculture industry that is animal products or feed crops. Imports don't play a role in it. So you may also want to revise the formula to essentially look at the share of total supply (Production + imports) that is used as feed crops, and assume that share applies to production. (I.e. imported grain and domestically produced grain are used interchangeably, when deciding whether to make grain into animal feed or human food). That should prevent there from being any values higher than 1.

robbieorvis commented 2 years ago

I think Megan may be fixing this?


Robbie Orvis Senior Director of Energy Policy Design +1 415-799-2171 1225 Eye Street, N.W. Suite 904 Washington, D.C. 20005 www.energyinnovation.orghttp://www.energyinnovation.org/ Sign up here to receive EPS modeling updateshttps://energyinnovation.org/energy-policy-solutions-updates/ @.***

From: Jeff Rissman @.> Sent: Friday, February 4, 2022 2:45 PM To: Energy-Innovation/eps-us @.> Cc: Robbie Orvis @.>; Author @.> Subject: Re: [Energy-Innovation/eps-us] Remove agricultural products for exported animal feed from calculations in indst\BSoAIGtAP (Issue #216)

Also you're getting some results above 1.0 (like in cell V21), which happens when large amounts of imports are used for feed. But we can't exceed 1.0 here because it's supposed to be the fraction of domestic agriculture industry that is animal products or feed crops. Imports don't play a role in it. So you may also want to revise the formula to essentially look at the share of total supply (Production + imports) that is used as feed crops, and assume that share applies to production. (I.e. imported corn and domestically produced corn are used interchangeably, when deciding whether to make corn into animal feed or human food). That should prevent there from being any values higher than 1.

— Reply to this email directly, view it on GitHubhttps://github.com/Energy-Innovation/eps-us/issues/216#issuecomment-1030296785, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AK5N6SOYVOUSQKXXIHLAMATUZQUDBANCNFSM5NSQWORA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.**@.>>

mkmahajan commented 2 years ago

I have already pushed the fixes Jeff pointed out for the China file Robbie shared!

I'm working on an update for the US, but am running into download issues with the OECD data set. It may be an issue with the website right now, so I'll revisit on Monday if I'm not able to complete the download today.

mkmahajan commented 2 years ago

Finished in commit 4cf2e30

jrissman commented 2 years ago

Perhaps we should make export handling a separate step in Vensim, because it looks like trying to exclude exports here is making the formulas difficult. And in any case, exclusion of exports shouldn't be tied exclusively to this policy, but should apply the same way to all the industrial demand reduction policies, which is a reason to move it to a separate step in Vensim rather than try to handle it inside this Excel file.

Let's say: C = domestic consumption F = domestic consumption for animal feed P = production I = imports E = exports

By definition, C = P + I - E

For non-animal products, the formula is currently:

animal-related fraction = [ F / ( P + I ) ] * [ ( P - E ) / P ]

This is the fraction of domestically available crops (including those ultimately exported) that were used for feed, multiplied by the share of domestic production that is not exported. I'm not actually sure about whether this formula is correctly excluding exports. But if we're not trying to do anything fancy to exclude exports inside this Excel file, the formula becomes simple:

animal-related fraction = F / C

or plugging in for C:

animal-related fraction = F / ( P + I - E )

For animal products, the formula is currently:

animal-related fraction = ( P - E ) / P

But if we're not trying to eliminate exports inside this variable, the formula becomes:

animal-related fraction = 1

I think we should consider simplifying the formulas within this Excel file, then changing all the demand reduction policies (not just the one for animal products) so that they don't affect exports. This requires a structural change in 3.3.2., so it isn't data-only anymore. This will be a good one for me to do jointly with Megan. (Optionally, we can add a policy lever that reduces exports of non-fuel goods, to complement the existing lever that reduces exports of fuels, if we think it would be worthwhile to represent such a policy.)

jrissman commented 2 years ago

For regions not updating to 3.3.2, I think it's okay to leave the formulas above alone. (I'm not suggesting you go back and change the China data file again.) I'm just thinking of implementing the cleanest possible solution going forward for 3.3.2.

robbieorvis commented 2 years ago

Thanks. I’m generally in favor of handling exports more cleanly, and I would push strongly to incorporate this also as part of the trade sensitivity structural updates outlined in issue 183https://github.com/Energy-Innovation/eps-us/issues/183, which are somewhat urgently needed.


Robbie Orvis Senior Director of Energy Policy Design +1 415-799-2171 1225 Eye Street, N.W. Suite 904 Washington, D.C. 20005 www.energyinnovation.orghttp://www.energyinnovation.org/ Sign up here to receive EPS modeling updateshttps://energyinnovation.org/energy-policy-solutions-updates/ @.***

From: Jeff Rissman @.> Sent: Monday, February 7, 2022 6:37 PM To: Energy-Innovation/eps-us @.> Cc: Robbie Orvis @.>; Author @.> Subject: Re: [Energy-Innovation/eps-us] Remove agricultural products for exported animal feed from calculations in indst\BSoAIGtAP (Issue #216)

For regions not updating to 3.3.2, I think it's okay to leave the formulas above alone. (I'm not suggesting you go back and change the China data file again.) I'm just thinking of implementing the cleanest possible solution going forward for 3.3.2.

— Reply to this email directly, view it on GitHubhttps://github.com/Energy-Innovation/eps-us/issues/216#issuecomment-1032048911, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AK5N6SOX4N2ZCC4YSEIA3ITU2BJQXANCNFSM5NSQWORA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.**@.>>

jrissman commented 2 years ago

We have decided to work on #183 before working on this item. #183 is moved to "Early Training."

jrissman commented 2 years ago

Megan and I updated the equations in BSoAIGtAP to work with new export shifting structure and renamed a different input variable with a clearer name. This issue is complete.