Skip to content

Commit

Permalink
reverted change from drate to interestrate in MACRO
Browse files Browse the repository at this point in the history
- reverted change from (constant) drate to (time-dependent) interestrate in MACRO 
- switched to lowercase spelling of drate
  • Loading branch information
volker-krey authored and gidden committed Mar 13, 2020
1 parent 875a1d5 commit 359e727
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions message_ix/model/MACRO/macro_calibration.gms
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Scalar
Variables
aeei_calibrate(node,sector,year_all)
grow_calibrate(node,year_all)
N_ITER
MAX_ITER
N_ITER
MAX_ITER
;

* ------------------------------------------------------------------------------
Expand Down Expand Up @@ -84,11 +84,11 @@ LOOP(year_all $( ORD(year_all) > sum(year_all2$( macro_initial_period(year_all2)
* new labor supply
newlab(node_macro, year_all) = SUM(year_all2$( seq_period(year_all2,year_all) ), (labor(node_macro, year_all) - labor(node_macro, year_all2)*(1 - depr(node_macro))**duration_period(year_all))$((labor(node_macro, year_all) - labor(node_macro, year_all2)*(1 - depr(node_macro))**duration_period(year_all)) > 0)) + epsilon ;
* calculation of utility discount factor based on discount rate (drate)
udf(node_macro, year_all) = SUM(year_all2$( seq_period(year_all2,year_all) ), udf(node_macro, year_all2) * (1 - (DRATE(node_macro) - grow(node_macro, year_all)))**duration_period(year_all)) ;
udf(node_macro, year_all) = SUM(year_all2$( seq_period(year_all2,year_all) ), udf(node_macro, year_all2) * (1 - (drate(node_macro) - grow(node_macro, year_all)))**duration_period(year_all)) ;
);

* recalcualte finite time horizon correction of utility function
finite_time_corr(node_macro, year) = abs(DRATE(node_macro) - grow(node_macro, year)) ;
finite_time_corr(node_macro, year) = abs(drate(node_macro) - grow(node_macro, year)) ;

) ;

Expand All @@ -99,7 +99,7 @@ grow_calibrate.L(node_macro,year) = grow(node_macro,year) ;
* subtract one due to 1-based indexing
N_ITER.L = ctr - 1;
MAX_ITER.L = max_it ;

* write solution statistics
status('MESSAGE_MACRO','modelstat') = 1 ;
status('MESSAGE_MACRO','solvestat') = 1 ;
Expand Down
4 changes: 2 additions & 2 deletions message_ix/model/MACRO/macro_data_load.gms
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ LOOP(year_all $( ORD(year_all) > sum(year_all2$( macro_initial_period(year_all2)
* new labor supply
newlab(node_macro, year_all) = SUM(year_all2$( seq_period(year_all2,year_all) ), (labor(node_macro, year_all) - labor(node_macro, year_all2)*(1 - depr(node_macro))**duration_period(year_all))$((labor(node_macro, year_all) - labor(node_macro, year_all2)*(1 - depr(node_macro))**duration_period(year_all)) > 0)) + epsilon ;
* calculation of utility discount factor based on discount rate (drate)
udf(node_macro, year_all) = SUM(year_all2$( seq_period(year_all2,year_all) ), udf(node_macro, year_all2) * (1 - (interestrate(year_all) - grow(node_macro, year_all)))**duration_period(year_all)) ;
udf(node_macro, year_all) = SUM(year_all2$( seq_period(year_all2,year_all) ), udf(node_macro, year_all2) * (1 - (drate(node_macro) - grow(node_macro, year_all)))**duration_period(year_all)) ;
);

DISPLAY labor, newlab, udf;
Expand Down Expand Up @@ -263,4 +263,4 @@ DISPLAY ecst0, k0, i0, c0, y0 ;
* simply taken.
* ------------------------------------------------------------------------------

finite_time_corr(node_macro, year) = abs(DRATE(node_macro) - grow(node_macro, year)) ;
finite_time_corr(node_macro, year) = abs(drate(node_macro) - grow(node_macro, year)) ;

0 comments on commit 359e727

Please sign in to comment.