
clc
clg
echo on
%
%
%
%     Equilibria of Several Adjustment Cost Economies
%
%
%  This demo computes impulse response functions of consumption and
%  investment in several one consumption good stochastic growth
%  economies.  The economies are versions of ones proposed by
%  Brock and Mirman, Hall,  Jones and Manuelli, Lucas and Prescott,
%  and Ryder and Heal.  There are costs of adjusting capital,
%  and potentially habit persistence in preferences.
%

pause  % press any key to continue demonstration
clc
%
%
%   The economy consists of a representative agent who maximizes
%   
%       -.5 E SUM { beta^t * (s(t) - 30)^2 ) + L(t)^2}
%
%       subject to c(t) + i(t) = gamma(1)* k(t-1) + d1(t),
%                  k(t) = deltak * k(t-1) + i(t)
%                  g(t) = phii(2)* i(t)
%                  L(t)^2 = g(t)^2
%
%                  s(t) = lambda* h(t-1) + pih * c(t)
%                  h(t) = deltah* k(t-1) + thetah * c(t)
%
%   where d1(t) is a first order autoregressive process with
%   mean 5, c(t) is consumption, L(t) is labor supplied, k(t) is
%   capital at end of period t, i(t) is investment, and g(t)^2 is
%   labor using intermediate production goods absorbed in adjusting capital;
%   h(t) is household capital, s(t) is services from household capital.
%
%   With different settings of parameters, we obtain different economies.
pause   %  press any key to continue
clc
%
%
%    Parameter settings:
%
%    Hall's economy:  lambda=0, phii(2) a very small positive number
%                     pih = 0; deltah and thetah irrelevant
%                     beta(deltak + gamma) =1.
%
%    Adjustment cost economy:  same parameters as Hall's model except
%                     that phii(2) is much bigger.
%
%
%    Jones-Manuelli growth economy:  same paramters as Hall's except
%                     that deltah = .9, lambda = -1.  This activates
%                     the habit persistence mechanism.
%
%
pause   %  press a key to continue with demonstration
clc
%
%
%
pause  %  press a key to compute equilibrium of Hall's model
%%
%
clex11
echo off
solvea
echo on
clc
pause   %  press a key to compute impulse response function to endowm shock
sy=[sc;si];
z=aimpulse(ao,c,sy,1,22);
v=[0 20 0 1];
axis(v);
jj=[0:20]';z=z(2:22,:);
plot(jj,z),title('impulse response of c and i with low adjust costs'),...
    pause
clc
pause % press a key to simulate consumption and investment in Hall's model
t1=80;
nt=t1;
asimul
axis
plot(y),title('cons and invest with low adjust costs'),pause
clc
%
%
       %  press a key to compute equilibrium and impulse response function
pause  %  for Hall economy with higher adjustment costs.
%
clex13
echo off
solvea
echo on
sy=[sc;si];
z=aimpulse(ao,c,sy,1,22);
v=[0 20 0 1];
axis(v);
jj=[0:20]';z=z(2:22,:);
plot(jj,z),title('impulse response of c and i with higher adjust costs'),...
    pause
clc
%
%
pause  %  press a key to simulate consumption and investment

t1=80;
nt=t1;
asimul
axis
plot(y),title('cons and invest with higher adjust costs'),pause
clc
      % press a key to compute equilibrium and impulse response function
pause % to endowment shock in Jones-Manuelli economy

%
clex10
echo off
solvea
echo on
sy=[sc;si];
z=aimpulse(ao,c,sy,1,42);
v=[0 40 0 1];
axis(v);
jj=[0:40]';z=z(2:42,:);
plot(jj,z),title('impulse response of c and i in Jones-Manuelli economy'),...
    pause
clc
%
%        press a key to simulate investment and consumption in Jones
pause  % Manuelli economy.
t1=80;
nt=t1;
asimul
axis

plot(y),title('cons and invest with low adjust costs'),pause

pause  %  press a key to return to menu


