%  clex101f.m

%  This program creates the matrices for a four period to maturity

%  "cattle model"

x0=[ 0 4.7 4.4 4.1 15.7 1.3 400 6 6 15 25 5 5 4 0 0 0 0 1]';

										

beta=.97;

alpha=.3;   % number of young cattle for each mature cow

del1=.94;   % depreciation rate for young cows

del2=.94;

del3=.95;

del4=.95;

del5=.99;

del6=.98;   % depreciation rate of capital in "Hall" part of model

del7=1;

del8=1;

del9=.99;

del10=.99;

del11=.99;

h1=.05;

h2=.055;

h3=.06;

h4=.07;

deltak11=[0 0 0 alpha 0 0;del1 0 0 0 0 0;0 del2 0 0 0 0;...

       0 0 del3 del4 0 0;0 0 0 0 del5 0;0 0 0 0 0 del6];

deltak22=[0 0 0 0 0 0 0;1 0 0 0 0 0 0;0 del7 del8 0 0 0 0;...

	0 0 0 1 0 0 0;-1 -1 0 1 -1 0 0;0 0 0 0 del9 0 0;...

	0 0 0 0 0 del10 del11]

deltak21=zeros(7,6);

deltak12=zeros(6,7);

deltak21(3,:)=[-h1 -h2 -h3 -h4 0 0];

deltak=[deltak11 deltak12; deltak21 deltak22];

thetak11=[0 0 0;0 0 0;0 0 0;-1 0 0;1 -1 0;0 0 1];

thetak12=zeros(6,2);

thetak21=zeros(7,3);

thetak22=zeros(7,2);

thetak22(1,1)=1;

thetak22(7,2)=-1;

thetak=[thetak11 thetak12;thetak21 thetak22];

phic11=[0 0;0 0;0 0;0 0;0 0;0 0;0 0;1 0;0 1];

phic21=zeros(3,2);

phic12=zeros(12,1);

phic1=[phic11;phic21];

phic=[phic1 phic12];

										

phig=zeros(9,7);

for i=1:7

phig(i,i)=1;

end

phig11=phig;

phig21=zeros(3,7);

phig12=zeros(9,2);

phig22=zeros(3,2);

phig=[phig11 phig12; phig21 phig22];

phig(10,8)=1;

										

phig(11,9)=1;

										

phic(12,3)=1;

										

gam1=.5;

gam2=.5;

gam3=.5;

gam4=.5;

gam5=2;     % labor costs of slaughtering

gamh=1;   % dependence of cost of converting meat on amount converted to cons

										

gam6=-1; % dependence of meat conversion costs on amount of stored meat.

	 % set gam6 < 0

gam9=.08;   % productivity of capital in Hall part of technology

%

%  gam9, del6, and beta are involved in the Manuelli-Jones 'growth cond'

%  that determines random-walkness in the Hall model.

%  set beta*(gam9+del6)=1 to get random walk in Hall component of model.

%

%    gam9=beta^(-1)-del6; % this line imposes the grth condn

phi3=2;  % costs of adjustment in Hall part of technology

phii=zeros(9,3);

phii(5,1)=-gam5;

phii(7,3)=-phi3;    % Hall like adjustment cost

phii(8,2)=-1;

phii(9,3)=1;

phii11=phii;

phii12=zeros(9,2);

phii21=zeros(3,3);

phii22=zeros(3,2);

phii=[phii11 phii12; phii21 phii22];

phii(12,5)=-1;           % fifth component of investment in consumption of corn

			 % by people

phii(10,4)=-2;        %  labor cost of investment in hog land

phii(11,5)=-1;        % labor cost of consumption of corn

gamma=zeros(9,6);

gamma(1,1)=gam1;

gamma(2,2)=gam2;

gamma(3,3)=gam3;

gamma(4,4)=gam4;

gamma(6,5)=gam6;

gamma(9,6)=gam9;

phii(6,2)=-gamh;

gamma11=gamma;

gamma12=zeros(9,7);

gamma21=zeros(3,6);

gamma22=zeros(3,7);

gamma=[gamma11 gamma12; gamma21 gamma22];

gamma(1:4,9)=[-1 -1 -1 -1]';

gamma(11,13)=-.15;   % benefits in terms of labor of

		  %    holding bigger stock of people eatable corn

gamma(10,11)=0;  % effect of k11 on g8(t)

deltah=0;

thetah=[0 0 0];

pih=[1 0 0;-.05 1 0 ; -.05 -.1 1];    % goods are specified to be substitutes

lambda=[0 0 0]';

a22=zeros(5,5);

a22(1,1)=.9;

a22(2,2)=.8;

a22(3,3)=.4;

a22(4,4)=.5;

a22(5,5)=1;

c2=zeros(5,4);

for i=1:4

c2(i,i)=1;

end

ub=[1 0 0 0 50;0 1 0 0 80; 0 0 0 0 10];  % b is first two components of z

ud=zeros(12,5);

ud(1,3)=1;

ud(9,4)=1;    % d1 is third component of z;d9 is the fourth comp of z



