$ontext
Here is a clean version of the overlapping generations model which I
sent on Friday.
It solves with a horizon of 2000 or 2002, but it fails for longer
horizons. I understand
the nature of the problems -- equilibrium prices tend to zero for
distant periods and
we have a nearly singular system due to the presence of disconnected
income sets for current
and future generations. It would be nice to know whether any of the
solvers is capable of
handling the 2010 or 2020 horizon problem.
-- Tom
$offtext
$Title A simple overlapping generations model in which agents live two periods
* This program works with 11 periods. It has trouble when many
* more periods. This is apparently due to numerical problems
* having to do with discounting.
set t time periods /1990*2020/,
t1(t) first time period,
tl(t) last time period;
scalar k0 initial capital stock /0.05 /
kvs capital value share / 0.3 /
rk0 base year return to capital per unit of capital /0.3/
srvshr one period capital survival share /0.5/
cshr value share of first period consumption /0.5/;
* Identify the first and last periods generically so that
* set t can be freely modified:
t1(t) = yes$(ord(t) eq 1);
tl(t) = yes$(ord(t) eq card(t));
* Declare the MPSGE model:
$ontext
$model:olg
$sectors:
y(t) ! Output
i(t) ! Investment
k(t) ! Capital stock
$commodities:
p(t) ! Price index for output
pk(t) ! Price index for capital
rk(t) ! Rental price of capital
w(t) ! Wage index
pkt ! Post-terminal capital and consumption
* One representative agent for each generation in the model.
* The generation which is old in the first period is generation
* 0:
$consumers:
ra0
ra(t)
* Production in period t requires input of labor and capital
* services:
$prod:y(t) s:1
o:p(t) q:1
i:w(t) q:1 p:(1-kvs)
i:rk(t) q:1 p:kvs
* Investment in period t generates capital in the subsequent
* period. Investment in the final period generates second
* period consumption for the cohort born in the terminal period:
$prod:i(t)
o:pk(t+1) q:1
o:pkt$tl(t) q:1
i:p(t) q:1
* Capital entering period t generates capital services in that
* period and depreciated capital in the subsequent period. Capital
* carried over from the final period produces second period
* consumption for the terminal period cohort:
$prod:k(t)
o:pk(t+1) q:srvshr
o:pkt$tl(t) q:srvshr
o:rk(t) q:rk0
i:pk(t) q:1
* The generation which is old in the first period is endowed
* with capital:
$demand:ra0
e:pk(t1) q:k0
d:p(t1)
* Each generation is endowed with 1 unit of labor in the
* first period of life and consumes output in both the first
* and second periods of life. The agent born in the final
* period purchases terminal capital in place of output in
* the post-terminal period.
$demand:ra(t) s:1
e:w(t) q:1
d:p(t) q:1
d:p(t+1) q:1
d:pkt$tl(t) q:1
$offtext
$sysinclude mpsgeset olg
* Normalize prices using the income level of the
* first generation:
ra0.fx = 1;
* Solve the MPSGE model:
olg.iterlim = 10000;
$include OLG.GEN
solve olg using mcp;
* Write out the MCP version of the model:
equations prf_y(t) Zero profit for production
prf_i(t) Zero profit for investment
prf_k(t) Zero profit for capital
mkt_y(t) Market clearance for output
mkt_l(t) Market clearance for labor
mkt_rk(t) Market clearance for capital services
mkt_k(t) Market clearance for capital stock
mkt_kt Market clearance for terminal capital
inc0 Income balance for cohort 0,
inc(t) Income balance for period t cohort;
prf_y(t).. (w(t)/(1-kvs))**(1-kvs) * (rk(t)/kvs)**kvs =e= p(t);
prf_i(t).. p(t) =e= pk(t+1) + pkt$tl(t);
prf_k(t).. pk(t) =e= rk0 * rk(t) + srvshr * (pk(t+1) + pkt$tl(t));
inc0.. ra0 =e= k0 * sum(t1, pk(t1));
inc(t).. ra(t) =e= w(t);
mkt_y(t).. p(t) * y(t) =e=
cshr * ra(t) + (1-cshr) * ra(t-1) + ra0$t1(t) + p(t) *
i(t);
mkt_l(t).. w(t) * 1 =e= 0.7 * p(t) * y(t);
mkt_rk(t).. rk0 * rk(t) * k(t) =e= kvs * p(t) * y(t);
mkt_k(t).. k0$t1(t) + srvshr * k(t-1) + i(t-1) =e= k(t);
mkt_kt.. pkt*sum(tl,srvshr*k(tl)+i(tl)) =e=
sum(tl,(1-cshr)*ra(tl));
model algebraic / prf_y.y, prf_i.i, prf_k.k, inc0.ra0, inc.ra,
mkt_y.p, mkt_l.w, mkt_rk.rk, mkt_k.pk, mkt_kt.pkt/;
* Verify that the algebraic model has the same equilibrium
* as the MPSGE model by issuing a solve with no iterations:
algebraic.iterlim = 0;
* solve algebraic using mcp;