%KCHECK   check depreciation rates used in our analysis.
%         See ./models directory.

%         Ellen McGrattan, 5-11-06


%
% Start by running accounts.m or accounts2.m
%

xbus        = cgpdif+cgpdii+ncgpdif+ncgpdii+netxm;
xnbus       = hhgpdif+npgpdif+pced-cdtax+govi;
xtot        = xbus+xnbus;
kbus        = kcfix+kcinv+cland+kppfix+ktefix+kncinv+nfbland;
knbus       = khhfix+hhland+knpfix+kgfix+kcd;
kbusnl      = kcfix+0*kcinv+kppfix+ktefix+0*kncinv;
knbusnl     = khhfix+knpfix+kgfix+kcd;
ktotnl      = kbusnl+knbusnl;

%
% Detrend and convert to real
%
Xbus        = xbus./(dgdp.*grate.*pcps)/gdp0;
Xnbus       = xnbus./(dgdp.*grate.*pcps)/gdp0;
X           = Xbus+Xnbus;
Kbus        = kbus./(dgdp.*grate.*pcps)/gdp0+.08;
Knbus       = knbus./(dgdp.*grate.*pcps)/gdp0;
K           = Kbus+Knbus;
Kbusnl      = kbusnl./(dgdp.*grate.*pcps)/gdp0;
Knbusnl     = knbusnl./(dgdp.*grate.*pcps)/gdp0;
Knl         = Kbusnl+Knbusnl;

eKbus(1)    = Kbus(1);
eKnbus(1)   = Knbus(1);
eKbusnl(1)  = Kbusnl(1);
eKnbusnl(1) = Knbusnl(1);
nk          = length(K);
delbus      = .035;
delnbus     = .035;
delbusnl    = .055;
delnbusnl   = .05;
for i=2:nk
  eKbus(i,1)     = ((1-delbus)*eKbus(i-1)+Xbus(i))/(1.02*1.01);
  eKnbus(i,1)    = ((1-delnbus)*eKnbus(i-1)+Xnbus(i))/(1.02*1.01);
  eKbusnl(i,1)   = ((1-delbusnl)*eKbusnl(i-1)+Xbus(i))/(1.02*1.01);
  eKnbusnl(i,1)  = ((1-delnbusnl)*eKnbusnl(i-1)+Xnbus(i))/(1.02*1.01);
end;

figure(1), plot(t,[Kbus,eKbus])
  title(['Business Capital with Land, \delta = ',num2str(delbus)], ...
         'Fontsize',14)
  axis([t(1),t(nk),1,2])
  legend('BEA','Ellen')
figure(2), plot(t,[Knbus,eKnbus]) 
  title(['Nonbusiness Capital with Land, \delta = ',num2str(delnbus)], ...
         'Fontsize',14)
  axis([t(1),t(nk),1.5,2.5])
  legend('BEA','Ellen')
figure(3), plot(t,[Kbusnl,eKbusnl]) 
  title(['Business Capital without Land, \delta = ',num2str(delbusnl)], ...
         'Fontsize',14)
  axis([t(1),t(nk),1,2])
  legend('BEA','Ellen')
figure(4), plot(t,[Knbusnl,eKnbusnl]) 
  title(['Nonbusiness Capital without Land, \delta = ',num2str(delnbusnl)], ...
         'Fontsize',14)
  axis([t(1),t(nk),1.5,2.5])
  legend('BEA','Ellen')
