Skip to content

Commit

Permalink
update in livestock regression and cost share regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Debbora Leip committed Sep 26, 2024
1 parent 82c5f15 commit 2d2c3d6
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cfg$model <- "main.gms" #def = "main.gms"
cfg$input <- c(regional = "rev4.112_h12_magpie.tgz",
cellular = "rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz",
validation = "rev4.112_h12_magpie.tgz",
additional = "additional_data_rev4.55.tgz",
additional = "additional_data_rev4.56.tgz",
calibration = "calibration_H12_26Mar24_fixed.tgz")

# NOTE: It is recommended to recalibrate the model when changing cellular input data
Expand Down
2 changes: 0 additions & 2 deletions modules/15_food/anthro_iso_jun22/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ q15_regr_kcal(iso) ..
*' This equation estimates key dietary composition regressision factors,
*' such as the share of animal products, empty calories, or
*' fruits, vegetables and nuts.
*' Note that regression coefficients are still based on USD05PPP values, but apllied
*' to income in USD17PPP since monetary units in MAgPIE have been updated.

q15_regr(iso, regr15) ..
v15_demand_regr(iso, regr15) =e=
Expand Down
2 changes: 0 additions & 2 deletions modules/15_food/anthropometrics_jan18/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ q15_regr_kcal(iso) ..
*' This equation estimates key dietary composition regressision factors,
*' such as the share of animal products, empty calories, or
*' fruits, vegetables and nuts.
*' Note that regression coefficients are still based on USD05PPP values, but apllied
*' to income in USD17PPP since monetary units in MAgPIE have been updated.

q15_regr(iso, regr15) ..
v15_demand_regr(iso, regr15) =e=
Expand Down
4 changes: 2 additions & 2 deletions modules/36_employment/exo_may22/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
*** | Contact: [email protected]

* capital cost share to split non-magpie factor costs into labor and capital
p36_share_calibration(i) = f36_hist_cap_share("y2010",i)-(f36_regr_cap_share("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso("y2010",iso)))+f36_regr_cap_share("intercept"));
p36_share_calibration(i) = f36_hist_cap_share("y2010",i)-(f36_regr_cap_share("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso))))+f36_regr_cap_share("intercept"));

if (m_year(t)<2010,
p36_cost_share(t,i) = f36_hist_cap_share(t,i);
elseif (m_year(t)>=2010),
p36_cost_share(t,i) = f36_regr_cap_share("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso(t,iso)))+f36_regr_cap_share("intercept")+p36_share_calibration(i);
p36_cost_share(t,i) = f36_regr_cap_share("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f36_regr_cap_share("intercept")+p36_share_calibration(i);
);

*' @code
Expand Down
4 changes: 2 additions & 2 deletions modules/38_factor_costs/per_ton_fao_may22/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ else
i38_fac_req(t,i,kcr) = i38_fac_req(t,i,kcr);
);

p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso("y2010",iso)))+f38_reg_parameters("intercept"));
p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept"));

if (m_year(t)<2010,
pm_cost_share_crops(t,i,"capital") = f38_historical_share(t,i);
pm_cost_share_crops(t,i,"labor") = 1 - f38_historical_share(t,i);

elseif (m_year(t)>=2010),
pm_cost_share_crops(t,i,"capital") = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso(t,iso)))+f38_reg_parameters("intercept")+p38_share_calibration(i);
pm_cost_share_crops(t,i,"capital") = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")+p38_share_calibration(i);
pm_cost_share_crops(t,i,"labor") = 1 - pm_cost_share_crops(t,i,"capital");
);
4 changes: 2 additions & 2 deletions modules/38_factor_costs/sticky_feb18/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ if (smax(j, pm_labor_prod(t,j)) <> 1 OR smin(j, pm_labor_prod(t,j)) <> 1,
abort "This factor cost realization cannot handle labor productivities != 1"
);

p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso("y2010",iso)))+f38_reg_parameters("intercept"));
p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept"));

if (m_year(t)<2010,
pm_cost_share_crops(t,i,"capital") = f38_historical_share(t,i);
pm_cost_share_crops(t,i,"labor") = 1 - f38_historical_share(t,i);

elseif (m_year(t)>=2010),
pm_cost_share_crops(t,i,"capital") = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso(t,iso)))+f38_reg_parameters("intercept")+p38_share_calibration(i);
pm_cost_share_crops(t,i,"capital") = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")+p38_share_calibration(i);
pm_cost_share_crops(t,i,"labor") = 1 - pm_cost_share_crops(t,i,"capital");
);

Expand Down
4 changes: 2 additions & 2 deletions modules/38_factor_costs/sticky_labor/preloop.gms
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ s38_ces_elast_par = (1/s38_ces_elast_subst) - 1 ;
p38_intr_depr(t,i) = (1-s38_depreciation_rate) * pm_interest(t,i)/(1+pm_interest(t,i)) + s38_depreciation_rate;

* calculate labor/capital cost shares from regression
p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso("y2010",iso)))+f38_reg_parameters("intercept"));
p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso)))+f38_reg_parameters("intercept"));

pm_cost_share_crops(t,i,"capital")$(m_year(t)<2010) = f38_historical_share(t,i);
pm_cost_share_crops(t,i,"capital")$(m_year(t)>=2010) = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso(t,iso)))+f38_reg_parameters("intercept")+p38_share_calibration(i);
pm_cost_share_crops(t,i,"capital")$(m_year(t)>=2010) = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")+p38_share_calibration(i);

pm_cost_share_crops(t,i,"labor") = 1 - pm_cost_share_crops(t,i,"capital");
2 changes: 0 additions & 2 deletions modules/70_livestock/fbask_jan16/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ q70_feed(i2,kap,kall) ..
*' productivity trajectories for simplification. Therefore,
*' `i70_cost_regr(i,kli,"cost_regr_b")` is set to zero in the case of livestock
*' products generated in monogastric systems.
*' Note that regression coefficients are still based on USD04MER values, while other
*' monetary units in MAgPIE have been updated to USD17MER.

*' To account for increased hourly labor costs and producitivity in case of an external
*' wage scenario, the total labor costs are scaled by the corresponding increase in hourly
Expand Down
2 changes: 1 addition & 1 deletion modules/70_livestock/fbask_jan16/input.gms
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $ondelim
$include "./modules/70_livestock/fbask_jan16/input/f70_livestock_productivity.cs3"
$offdelim;

table f70_cost_regr(kap,cost_regr) Factor requirements livestock (USD04 per tDM (A) and USD (B))
table f70_cost_regr(kap,cost_regr) Factor requirements livestock (USD17MER per tDM (A) and USD17MER (B))
$ondelim
$include "./modules/70_livestock/fbask_jan16/input/f70_capit_liv_regr.csv"
$offdelim
Expand Down
2 changes: 0 additions & 2 deletions modules/70_livestock/fbask_jan16_sticky/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ q70_feed(i2,kap,kall) ..
*' productivity trajectories for simplification. Therefore,
*' `i70_cost_regr(i,kli,"cost_regr_b")` is set to zero in the case of livestock
*' products generated in monogastric systems.
*' Note that regression coefficients are still based on USD04MER values, while other
*' monetary units in MAgPIE have been updated to USD17MER.

*' To account for increased hourly labor costs and producitivity in case of an external
*' wage scenario, the total labor costs are scaled by the corresponding increase in hourly
Expand Down
2 changes: 1 addition & 1 deletion modules/70_livestock/fbask_jan16_sticky/input.gms
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_livestock_productivity.cs3"
$offdelim;

table f70_cost_regr(kap,cost_regr) Factor requirements livestock (USD04 per tDM (A) and USD (B))
table f70_cost_regr(kap,cost_regr) Factor requirements livestock (USD17MER per tDM (A) and USD17MER (B))
$ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_capit_liv_regr.csv"
$offdelim
Expand Down

0 comments on commit 2d2c3d6

Please sign in to comment.