% params

rl=['$\gamma$  ';
    '$\omega$  ';
    '$\alpha_0$';
    '$\eta$    ';
    '$\alpha$  ';
    '$\theta$  ';
    '$\phi_1$  ';
    '$\phi_2$  ';
    '$\phi_3$  ';
    '$J$       '];
cl1=['Tax 1 ';
     'Tax 2 '; 
     'Tax 3 '; 
     'Tax 4 '; 
     'Tax 5 '; 
     'No Tax']; 


T1=[.253 -.320 .0562 .955 -.0103 .601 .267 .264 .192 6.11;
    .274 -.611  .157 .951 -.0131 .642 .329 .384 .058 6.64 ;
    .244 -.473 -.212 1.18 -.0456 .640 .366 .270 .163 6.26;
    .247 -.449 -.180 1.20 -.0211 .643 .376 .334 .0499 6.76;
    .249 -.451 .0397 1.01 -.0421 .638 .377 .224 .212 6.07 ;
    .754 -2.44 .0808 1.71 .00139 .720 .333 .401 .0394 6.04] ;
    

S1=[.0923 .133 5.68 6.78 .0641 .00535 .183 .143 .128 .86 ; 
    .398 .041 2.11 29.7 .801 .00537 .188 .182 .145 .82;
    .086 .1414 2.46 1.86 .0843 .0079 .302 .209 .186 .85;
    .0886 .151 2.21 1.73 .0393 .0061 .230 .196 .146 .81;
    .00652 .0553 3.84 4.28 .0801 .00669 .283 .157 .138 .86; 
    13.004 140.7 21.5 13.3 .0393 .00299 .197 .167 .149 .87];  

tab1=textab2(T1',S1',2,1,0,0,cl1,0,rl, ..
'{\bf  Table 1. GMM Parameter Estimates}')

% Time series

cl1=['3 Tax 1';
    '3 Tax 2'; 
    '3 Tax 5'; 
    '1      ']; 
cl2=[ ..
     'model 1 ';
     'model 2 ';
     'model 3 ';
     'model 1 ';
     'model 2 ';
     'model 3 ';
     'model 1 ';
     'model 2 ';
     'model 3 ';
     'No Tax  '];
rl=['$C_t$';
    '$I_t$';
    '$Y_t$';
    '$K_t$';
    '$N_t$'];

T2=[ 2.56,14.62,3.72,1.77,4.63;
    1.45,5.95,2.00,.825,1.529;
    1.28,5.45,1.795,.677,1.26;
    3.05,18.54,4.45,1.97,5.35;
    1.385,8.24,2.01,1.115,1.66;
    1.45,5.41,2.10,.607,1.32;
    2.52,15.22,3.56,1.61,4.31;
    1.61,6.89,2.226,.928,1.896;
    1.52,5.89,2.192,.686,1.57;
    .971,4.391,1.41,.5429,.188];
    
S2=[.676,4.24,1.01,.463,1.18;
    .402,1.045,.567,.266,.428;
    .167,.655,.287,.0802,.208;
    .535,4.14,.809,.416,.812;
    .166,1.71,.255,.211,.227;
    .294,.707,.471,.139,.236;
    .318,2.04,.480,.158,.497;
    .418,1.61,.581,.216,.387;
    .280,.533,.436,.129,.241;
    .212,.923,.333,.150,.0189];

tab2=textab2(T2',S2',2,1,0,cl1,cl2,0,rl, ..
'{\bf Table 2. Standard Deviations}')


load /home/mcgrattan/distortions/temp/vd2
V=vd2;
T3a=[V(32,:);V(1,:);V(33,:)];
T3b=[V(65,:);V(34,:);V(66,:)];
T3c=[V(98,:);V(67,:);V(99,:)];
T3d=[V(131,:);V(100,:);V(132,:)];

cl1=[ ..
     '$\lambda$';
     '$G$      ';
     '$\tau_k$ ';
     '$\tau_n$ '];
rl=['$I$';
    '$K$';
    '$N$'];
    

tab3aa=textab1(T3a,2,1,0,0,cl1,0,rl, ..
'{\bf Table 3a. Variance Decomposition with ordering: $\lambda,G,\tau_k,\tau_n$}')
tab3ba=textab1(T3b,2,1,0,0,cl1([2:4,1],:),0,rl, ..
'{\bf Table 3b. Variance Decomposition with ordering: $G,\tau_k,\tau_n,\lambda$}')
tab3ca=textab1(T3c,2,1,0,0,cl1([3:4,1:2],:),0,rl, ..
'{\bf Table 3c. Variance Decomposition with ordering: $\tau_k,\tau_n,\lambda,G$}')
tab3da=textab1(T3d,2,1,0,0,cl1([4,1:3],:),0,rl, ..
'{\bf Table 3d. Variance Decomposition with ordering: $\tau_n,\lambda,G,\tau_k$}')

load /home/mcgrattan/distortions/temp/vd3;
V=vd3;
T3ab=[V(32,:);V(1,:);V(33,:)];
T3bb=[V(65,:);V(34,:);V(66,:)];
T3cb=[V(98,:);V(67,:);V(99,:)];
T3db=[V(131,:);V(100,:);V(132,:)];

cl1=[ ..
     '$\lambda$';
     '$G$      ';
     '$\tau_k$ ';
     '$\tau_n$ '];
rl=['$I$';
    '$K$';
    '$N$'];
    

tab3aa=textab1(T3a,2,1,0,0,cl1,0,rl, ..
'{\bf Table 3a. Variance Decomposition with ordering: $\lambda,G,\tau_k,\tau_n$}')
tab3ba=textab1(T3b,2,1,0,0,cl1([2:4,1],:),0,rl, ..
'{\bf Table 3b. Variance Decomposition with ordering: $G,\tau_k,\tau_n,\lambda$}')
tab3ca=textab1(T3c,2,1,0,0,cl1([3:4,1:2],:),0,rl, ..
'{\bf Table 3c. Variance Decomposition with ordering: $\tau_k,\tau_n,\lambda,G$}')
tab3da=textab1(T3d,2,1,0,0,cl1([4,1:3],:),0,rl, ..
'{\bf Table 3d. Variance Decomposition with ordering: $\tau_n,\lambda,G,\tau_k$}')

load /home/mcgrattan/distortions/temp/vd4
V=vd4;
T3a=[V(32,:);V(1,:);V(33,:)];
T3b=[V(65,:);V(34,:);V(66,:)];
T3c=[V(98,:);V(67,:);V(99,:)];
T3d=[V(131,:);V(100,:);V(132,:)];

cl1=[ ..
     '$\lambda$';
     '$G$      ';
     '$\tau_k$ ';
     '$\tau_n$ '];
rl=['$I$';
    '$K$';
    '$N$'];
    

tab3ac=textab1(T3a,2,1,0,0,cl1,0,rl, ..
'{\bf Table 3a. Variance Decomposition with ordering: $\lambda,G,\tau_k,\tau_n$}')
tab3bc=textab1(T3b,2,1,0,0,cl1([2:4,1],:),0,rl, ..
'{\bf Table 3b. Variance Decomposition with ordering: $G,\tau_k,\tau_n,\lambda$}')
tab3cc=textab1(T3c,2,1,0,0,cl1([3:4,1:2],:),0,rl, ..
'{\bf Table 3c. Variance Decomposition with ordering: $\tau_k,\tau_n,\lambda,G$}')
tab3dc=textab1(T3d,2,1,0,0,cl1([4,1:3],:),0,rl, ..
'{\bf Table 3d. Variance Decomposition with ordering: $\tau_n,\lambda,G,\tau_k$}')



cl1=['3 Tax 1';
    '3 Tax 2'; 
    '3 Tax 5']; 
cl2=[ ..
     'model 1 ';
     'model 2 ';
     'model 3 ';
     'model 1 ';
     'model 2 ';
     'model 3 ';
     'model 1 ';
     'model 2 ';
     'model 3 '];
rl=['$\partial u/\partial\tau^s\cdot 10^{-5}$';
    '$\partial R/\partial\tau^s\cdot 10^{-5}$';
    '$-(1)/(2) $                             '];
 
T4a=[[-2.5160e+4,-3.6276e+5,-8.6359e+5,-1.036e+4,-1.8229e+4,-3.3347e+5, ..
      -1.1401e+4,-1.0664e+5,-7.4003e+5]/10^5;      
     [-2.0802e+4,-2.1256e+6,1.0946e+6,-3.0410e+4,-1.2009e+6,6.1012e+5, ..
       -2.1032e+4,-2.3652e+6,1.2442e+6]/10^5; 
      -1.2095,-.17066,.7889,-.3407,-.015179,.5466, ..
       -.54216,-.045087,.5948];
T4b=[[-2.629e+4,-4.7849e+5,-2.2774e+6,-2.3313e+4,-5.3342e+5,-2.0636e+6, ..
      -2.3832e+4,-5.5359e+5,-1.2497e+6]/10^5; 
     [1.2506e+5,2.3866e+6,9.876e+6,1.4187e+5,2.7786e+6,1.0742e+7, ..
       1.0742e+7,1.2068e+5,5.7894e+6 ]/10^5;
     .2102,.20049,.2306,.16433,.19197,.1921,.19748,.2095,.2159  ] ;


tab4a=textab1(T4a,2,1,0,cl1,cl2,0,rl, ..
  '{\bf Table 4a. Welfare Costs of Capital Taxation}')
tab4b=textab1(T4b,2,1,0,cl1,cl2,0,rl, ..
  '{\bf Table 4b. Welfare Costs of Labor Taxation}')


