Ramsey : An Elementary Ramsey Growth Model

Reference

  • Neculai Andrei, Nonlinear Optimization Applications Using the GAMS Technology,Springer Optimization and Its Applications, Model Ramsey (9.1) in chapter Economic Development , 2013

Category : GAMS NOA library


Mainfile : ramsey.gms

$ontext
An elementary Ramsey growth model

References:
Frank P. Ramsey, A Mathematical Theory of Saving, Economics Journal,
vol.38, No. 152, December 1928.

Erwin Kalvelagen, (2003) An elementary Ramsey growth model.
http://www.gams.com/~erwin/micro/growth.gms
$offtext

set  t       'time periods'                  / t1*t50 /

scalars
      rho    'discount factor'               / 0.04 /
      g      'labor growth rate'             / 0.03 /
      delta  'capital depreciation factor'   / 0.02 /
      K0     'initial capital'               / 3.00 /
      I0     'initial investment'            / 0.07 /
      C0     'initial consumption'           / 0.95 /
      L0     'initial labor'                 / 1.00 /
      b      'Cobb Douglas coefficient'      / 0.25 /
      a      'Cobb Douglas coefficient'  ;

sets
      tfirst(t)   'first interval (t0)'
      tlast(t)    'last intervat (T)'
      tnotlast(t) 'all intervals but last' ;

tfirst(t)$(ord(t)=1) = yes;
tlast(t)$(ord(t)=card(t)) = yes;
tnotlast(t)= not tlast(t);

parameters
      L(t)      'labor (production input)'
      beta(t)   'weight factor for future utilities'
      tval(t)   'numerical value of t'  ;

tval(t) = ord(t)-1;

* The terminal weight beta(tlast) computation.
beta(tnotlast(t)) = power(1+rho,-tval(t));
beta(tlast(t)) = (1/rho)*power(1+rho,1-tval(t));
display beta;

* Labor is determined using an exponential growth process.
L(t) = power(1+g,tval(t)) * L0;

* Cobb-Douglas coefficient a computation.
a = (C0 + I0) / (K0**b * L0**(1-b));

variables
      C(t)      'consumption'
      Y(t)      'production'
      K(t)      'capital'
      I(t)      'investment'
      W         'total utility'  ;

equation
      utility         'discounted utility'
      production(t)   'Cobb-Douglas production function'
      allocation(t)   'household choose between consumption and saving'
      accumulation(t) 'capital accumulation'
      final(t)        'minimal investment in final period'  ;

utility..          W =e= sum(t, beta(t)*log(C(t)));
production(t)..    Y(t) =e= a * (K(t)**b) * (L(t)**(1-b));
allocation(t)..    Y(t) =e= C(t) + I(t);
accumulation(tnotlast(t))..  K(t+1) =e= (1-delta)*K(t) + I(t);
final(tlast)..     I(tlast) =g= (g+delta)*K(tlast);

* Bounds.
K.lo(t) = 0.001;
C.lo(t) = 0.001;

* Initial conditions
K.fx(tfirst) = K0;
I.fx(tfirst) = I0;
C.fx(tfirst) = C0;

model ramsey /all/;

$iftheni x%mode%==xbook
$onecho >bench.opt
  solvers conopt knitro minos
$offecho
ramsey.optfile=1;
option nlp=bench;

$endif

solve ramsey maximizing W using nlp;
*
* Solution visualization
* ----------------------
*

$iftheni x%mode%==xbook
file res1 /growth.txt/
put res1;
put /"timp    C(t)  Y(t)  K(t)  I(t) "/;
loop(t, put t.tl:6, C.l(t):6, Y.l(t):6, K.l(t):6, I.l(t):6 /;);

file capital /cap.dat/
put capital;
loop(t, put K.l(t):10:7, put/);

file produc / prod.dat/
put produc
loop(t, put Y.l(t):10:7, put/);

file consum /cons.dat/
put consum;
loop(t, put C.l(t):10:7, put/);

file investitie /invest.dat/
put investitie;
loop(t, put I.l(t):10:7, put/);

display beta
$endif

* End Ramsey