%SIMINTANG  Plot simulations generated by intang.f90 or intang_sparse.f90.  
%           See details about model economy in Fortran code.

%           Ellen McGrattan, 8-22-04

load intang.dat

state  = intang(:,1);
n      = length(state);
t0     = 1;
t1     = t0-1+n;
t      = [t0:t1]';

kb     = intang(:,2);
ki     = intang(:,3);
kbf    = intang(:,4);
kbi    = intang(:,5);
hbf    = intang(:,6);
hbi    = intang(:,7);
yb     = intang(:,8);
c      = intang(:,9);
h      = intang(:,10);
xb     = intang(:,11);
xi     = intang(:,12);
q      = intang(:,13);
qxi    = intang(:,14);
d      = intang(:,15);
rb     = intang(:,16);
ri     = intang(:,17);
w      = intang(:,18);
z1     = intang(:,19);
z2     = intang(:,20);
tauc   = intang(:,21);
tauh   = intang(:,22);
taux   = intang(:,23);
tauk   = intang(:,24);
taup   = intang(:,25);
taud   = intang(:,26);
g      = intang(:,27);
yn     = intang(:,28);
xn     = intang(:,29);
hn     = intang(:,30);

usdat  = [1990    0.2751    0.6621
          1991    0.2698    0.6331
          1992    0.2688    0.6336
          1993    0.2722    0.6295
          1994    0.2776    0.6390
          1995    0.2797    0.6443
          1996    0.2824    0.6556
          1997    0.2857    0.6710
          1998    0.2871    0.6897
          1999    0.2887    0.7012
          2000    0.2855    0.7029
          2001    0.2790    0.6776
          2002    0.2738    0.6558
          2003    0.2752    0.6460];

t      = usdat(:,1);
hdat   = usdat(:,2);
ybdat  = usdat(:,3);
lshare = .6608;

figure(1)
set(gca,'Fontsize',14)
plot(1990:2010,z1(1:21).^lshare,'Linewidth',2,'Color','r')
line(1990:2010,z2(1:21).^lshare,'Linewidth',2,'Color','b')
title( 'TFPs in Final Production and Intangible Production')
legend('Final','Intangible','Location','Northwest')
axis([1990,2010, 1.2,1.8])

figure(2)
set(gca,'Fontsize',14)
plot(t,hdat,'Linewidth',2,'Color','k')
line(t,h(1:14),'Linewidth',2,'Color','r','Marker','^')
title( 'US Hours and Model Prediction')
legend('US Hours','Model Hours','Location','Northwest')
axis([1990,2003,.265,.295])

figure(3)
set(gca,'Fontsize',14)
plot(t,ybdat,'Linewidth',2,'Color','k')
line(t,yb(1:14),'Linewidth',2,'Color','r','Marker','^')
title( 'US Business Value Added and Model Prediction')
legend('US Business Value Added','Model Business Value Added', ...
       'Location','Southeast')
axis([1990,2003,.62,.71])

