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

Expand the MC and point estimates. #413

Merged
merged 7 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20240906
20240907
28 changes: 22 additions & 6 deletions pt/index.json_template
Original file line number Diff line number Diff line change
Expand Up @@ -1590,15 +1590,31 @@
"name": "manual",
"label": "Manual Changes",
"levers": [
{
"name": "Amortized model offset",
"description": "How much of amortized error should be offset in model point estimations.",
"min": 0,
"max": 100,
"default": 100,
"step": 1,
"units": "%",
"forcePlus": true,
"variable": "amortizedModelOffset",
"template": "noop.pt",
"released": true,
"priority": -200,
"attrs": {},
"url": "https://global-plastics-tool.org/pdf/ml.pdf"
},
{% for region in regions %}
{% for sector in sectors %}
{
"name": "{{ region['label'] }} Consumption Offset for {{ sector['label'] }}",
"description": "How many metric tons to offset consumption for {{ sector['label'] }} like to capture BAU model uncertainty.",
"min": -100,
"max": 100,
"default": 0,
"step": 1,
"default": {{ region['constants']['consumptionErrorMean'] }},
"step": 0.01,
"units": "Mt",
"forcePlus": true,
"variable": "{{ region['key'] }}PreConsumption{{ sector['key'] }}MT",
Expand Down Expand Up @@ -1635,8 +1651,8 @@
"description": "Percentage offset for {{ fate['label'] }} like to capture BAU model uncertainty.",
"min": -100,
"max": 100,
"default": 0,
"step": 1,
"default": {{ region['constants']['wasteErrorMean'] }},
"step": 0.1,
"units": "%",
"forcePlus": true,
"variable": "{{ region['key'] }}PreDelta{{ fate['key'] }}Percent",
Expand Down Expand Up @@ -1672,7 +1688,7 @@
"description": "Offset in goods trade as percent of consumption like to capture model uncertainty.",
"min": -100,
"max": 100,
"default": 0,
"default": {{ region['constants']['tradeErrorMean'] }},
"step": 1,
"units": "%",
"forcePlus": true,
Expand All @@ -1692,7 +1708,7 @@
"description": "Offset in waste trade as percent of consumption like to capture model uncertainty.",
"min": -100,
"max": 100,
"default": 0,
"default": {{ region['constants']['wasteTradeMean'] }},
"step": 1,
"units": "%",
"forcePlus": true,
Expand Down
89 changes: 80 additions & 9 deletions pt/pre_consumption.pt
Original file line number Diff line number Diff line change
@@ -1,13 +1,84 @@
# Determine deltas
# Determine how much change is allowed
var allowedMultiplier = in.{{ region }}PreConsumptionMultiplier / 100;
var agricultureDelta = in.{{ region }}PreConsumptionAgricultureMT * allowedMultiplier;
var constructionDelta = in.{{ region }}PreConsumptionConstructionMT * allowedMultiplier;
var electronicDelta = in.{{ region }}PreConsumptionElectronicMT * allowedMultiplier;
var hlsDelta = in.{{ region }}PreConsumptionHouseholdLeisureSportsMT * allowedMultiplier;
var packagingDelta = in.{{ region }}PreConsumptionPackagingMT * allowedMultiplier;
var transportationDelta = in.{{ region }}PreConsumptionTransportationMT * allowedMultiplier;
var textileDelta = in.{{ region }}PreConsumptionTextileMT * allowedMultiplier;
var otherDelta = in.{{ region }}PreConsumptionOtherMT * allowedMultiplier;
var amortizedMultiplier = in.amortizedModelOffset / 100;
var pointDuration = 2050 - 2023; # Start applying offset in 2023.

# Determine deltas from Monte Carlo
var agricultureDeltaMc = in.{{ region }}PreConsumptionAgricultureMT * allowedMultiplier;
var constructionDeltaMc = in.{{ region }}PreConsumptionConstructionMT * allowedMultiplier;
var electronicDeltaMc = in.{{ region }}PreConsumptionElectronicMT * allowedMultiplier;
var hlsDeltaMc = in.{{ region }}PreConsumptionHouseholdLeisureSportsMT * allowedMultiplier;
var packagingDeltaMc = in.{{ region }}PreConsumptionPackagingMT * allowedMultiplier;
var transportationDeltaMc = in.{{ region }}PreConsumptionTransportationMT * allowedMultiplier;
var textileDeltaMc = in.{{ region }}PreConsumptionTextileMT * allowedMultiplier;
var otherDeltaMc = in.{{ region }}PreConsumptionOtherMT * allowedMultiplier;

# Determine deltas from point estimate offsets (non-Monte Carlo)
var agricultureDeltaPoint = 0;
var agricultureDeltaPointMax = in.{{ region }}PreConsumptionAgricultureMT;
agricultureDeltaPointMax = agricultureDeltaPointMax * allowedMultiplier;
agricultureDeltaPointMax = agricultureDeltaPointMax * amortizedMultiplier;
agricultureDeltaPointMax = agricultureDeltaPointMax * pointDuration;
change agricultureDeltaPoint by agricultureDeltaPointMax over 2023 to 2050;

var constructionDeltaPoint = 0;
var constructionDeltaPointMax = in.{{ region }}PreConsumptionConstructionMT;
constructionDeltaPointMax = constructionDeltaPointMax * allowedMultiplier;
constructionDeltaPointMax = constructionDeltaPointMax * amortizedMultiplier;
constructionDeltaPointMax = constructionDeltaPointMax * pointDuration;
change constructionDeltaPoint by constructionDeltaPointMax over 2023 to 2050;

var electronicDeltaPoint = 0;
var electronicDeltaPointMax = in.{{ region }}PreConsumptionElectronicMT;
electronicDeltaPointMax = electronicDeltaPointMax * allowedMultiplier;
electronicDeltaPointMax = electronicDeltaPointMax * amortizedMultiplier;
electronicDeltaPointMax = electronicDeltaPointMax * pointDuration;
change electronicDeltaPoint by electronicDeltaPointMax over 2023 to 2050;

var hlsDeltaPoint = 0;
var hlsDeltaPointMax = in.{{ region }}PreConsumptionHouseholdLeisureSportsMT;
hlsDeltaPointMax = hlsDeltaPointMax * allowedMultiplier;
hlsDeltaPointMax = hlsDeltaPointMax * amortizedMultiplier;
hlsDeltaPointMax = hlsDeltaPointMax * pointDuration;
change hlsDeltaPoint by hlsDeltaPointMax over 2023 to 2050;

var packagingDeltaPoint = 0;
var packagingDeltaPointMax = in.{{ region }}PreConsumptionPackagingMT;
packagingDeltaPointMax = packagingDeltaPointMax * allowedMultiplier;
packagingDeltaPointMax = packagingDeltaPointMax * amortizedMultiplier;
packagingDeltaPointMax = packagingDeltaPointMax * pointDuration;
change packagingDeltaPoint by packagingDeltaPointMax over 2023 to 2050;

var transportationDeltaPoint = 0;
var transportationDeltaPointMax = in.{{ region }}PreConsumptionTransportationMT;
transportationDeltaPointMax = transportationDeltaPointMax * allowedMultiplier;
transportationDeltaPointMax = transportationDeltaPointMax * amortizedMultiplier;
transportationDeltaPointMax = transportationDeltaPointMax * pointDuration;
change transportationDeltaPoint by transportationDeltaPointMax over 2023 to 2050;

var textileDeltaPoint = 0;
var textileDeltaPointMax = in.{{ region }}PreConsumptionTextileMT;
textileDeltaPointMax = textileDeltaPointMax * allowedMultiplier;
textileDeltaPointMax = textileDeltaPointMax * amortizedMultiplier;
textileDeltaPointMax = textileDeltaPointMax * pointDuration;
change textileDeltaPoint by textileDeltaPointMax over 2023 to 2050;

var otherDeltaPoint = 0;
var otherDeltaPointMax = in.{{ region }}PreConsumptionOtherMT;
otherDeltaPointMax = otherDeltaPointMax * allowedMultiplier;
otherDeltaPointMax = otherDeltaPointMax * amortizedMultiplier;
otherDeltaPointMax = otherDeltaPointMax * pointDuration;
change otherDeltaPoint by otherDeltaPointMax over 2023 to 2050;

# Determine overall deltas
var agricultureDelta = agricultureDeltaMc + agricultureDeltaPoint;
var constructionDelta = constructionDeltaMc + constructionDeltaPoint;
var electronicDelta = electronicDeltaMc + electronicDeltaPoint;
var hlsDelta = hlsDeltaMc + hlsDeltaPoint;
var packagingDelta = packagingDeltaMc + packagingDeltaPoint;
var transportationDelta = transportationDeltaMc + transportationDeltaPoint;
var textileDelta = textileDeltaMc + textileDeltaPoint;
var otherDelta = otherDeltaMc + otherDeltaPoint;

# Apply limits
limit agricultureDelta to [-1 * out.{{ region }}.consumptionAgricultureMT,];
Expand Down
Loading