function X1= mod3ss(param);
%MOD3SS   computes the steady state for model 3.  
%         See notes.tex for details.

%         Ellen McGrattan, 4-10-09
%         Revised, ERM, 6-20-11

%
% Values to target
%

y       = param(1);
yn      = param(2);
GDP     = y+yn;
c       = param(3);
xt      = param(4);
xn      = param(5);
g       = param(6);
kt      = param(7);
h       = param(8);
hn      = param(9);
NIPAbw  = param(10);
tauc    = param(11);
tauh    = param(12);
taub    = param(13);
taux    = param(14);
tauk    = param(15);
taup    = param(16);
taud    = param(17);
gn      = param(18);
gz      = param(19);
phi     = param(20);
q       = param(21);
chi     = param(22);
deli    = param(23);
beta    = param(24);
isymm   = param(25);
if (isymm~=1)
  alph2 = param(26);
  thet2 = param(27);
end;


X0      = [.11;.21];
X0      = [.15;.21];
X1      = secant('foc3ss',X0,param,1e-10,100);


alph1   = X1(1);
thet1   = X1(2);
[res,V] = foc3ss(X1,param);
k1t     = V(1);
k2t     = V(2);
h1      = V(3);
h2      = V(4);
qxi     = V(5);
xi      = V(6);
ki      = V(7);
z1      = V(8);
z2      = V(9);
delt    = V(10);
psi     = V(11);
alph2   = V(12);
thet2   = V(13);
w       = V(14);
rt      = V(15);
ri      = V(16);
txc     = tauc*c;
txh     = tauh*w*(h-hn);
se      = taub*(1-chi)*q*xi;
txx     = taux*xt;
txk     = tauk*kt;
txp     = taup*((rt-delt-tauk)*kt+ri*ki-chi*q*xi);
txd     = taud*((rt-tauk)*kt-xt-txx-txp);
tx      = txc+txh-se+txx+txk+txp+txd;

disp('Parameter Values for Model 3')
disp('----------------------------')
disp('  Preferences')
disp(sprintf('    Discount factor                    %8.4f',beta))
disp(sprintf('    Utility curvature                  %8.4f',phi))
disp(sprintf('    Utility weight                     %8.4f',psi))
disp('  Growth rates')
disp(sprintf('    Population                         %8.4f',gn))
disp(sprintf('    Technology                         %8.4f',gz))
disp('  Depreciation rates')
disp(sprintf('    Tangible                           %8.4f',delt))
disp(sprintf('    Intangible                         %8.4f',deli))
disp('  Capital Shares')
disp(sprintf('    Tangible, final g&s production     %8.4f',thet1))
disp(sprintf('    Intangible, final g&s production   %8.4f',alph1))
disp(sprintf('    Tangible, intangible production    %8.4f',thet2))
disp(sprintf('    Intangible, intangible production  %8.4f',alph2))
disp('  Tax rates on')
disp(sprintf('    Consumption                        %8.4f',tauc))
disp(sprintf('    Labor (of worker)                  %8.4f',tauh))
disp(sprintf('    Labor (of business owner)          %8.4f',taub))
disp(sprintf('    Investment                         %8.4f',taux))
disp(sprintf('    Property                           %8.4f',tauk))
disp(sprintf('    Profits                            %8.4f',taup))
disp(sprintf('    Dividends                          %8.4f',taud))
disp('  Fraction of intangible expensed from')
disp(sprintf('    Compensation                       %8.4f',1-chi))
disp(sprintf('    Profits                            %8.4f',chi))
disp('  Levels of technology')
disp(sprintf('    Final g&s production               %8.4f',z1))
disp(sprintf('    Intangible production              %8.4f',z2))
disp(' ')

disp(' ')
disp('Steady State for Model 3')
disp('------------------------')
disp('  Consumptions ')
disp(sprintf('    Private                            %8.4f',c))
disp(sprintf('    Public                             %8.4f',g))
disp('  Investments')
disp(sprintf('    Tangible                           %8.4f',xt))
disp(sprintf('    Intangible                         %8.4f',xi))
disp(sprintf('    Nonbusiness                        %8.4f',xn))
disp('  Outputs')
disp(sprintf('    Business                           %8.4f',y))
disp(sprintf('    Nonbusiness                        %8.4f',yn))
disp('  Incomes')
disp(sprintf('    Business                           %8.4f',y))
disp(sprintf('      Labor income                     %8.4f', ...
                                       w*(h1+h2)-(1-chi)*q*xi))
disp(sprintf('      Capital income                   %8.4f', ...
                                       rt*kt+ri*ki-chi*q*xi-delt*kt))
disp(sprintf('      Depreciation                     %8.4f',delt*kt))
disp(sprintf('    Nonbusiness                        %8.4f',yn))
disp('  Capital Stocks ')
disp(sprintf('    Tangible                           %8.4f',kt))
disp(sprintf('      in final g&s production          %8.4f',k1t))
disp(sprintf('      in intangible production         %8.4f',k2t))
disp(sprintf('    Intangible                         %8.4f',ki))
disp('  Hours ')
disp(sprintf('    Business                           %8.4f',h-hn))
disp(sprintf('      in final g&s production          %8.4f',h1))
disp(sprintf('      in intangible production         %8.4f',h2))
disp(sprintf('    Nonbusiness                        %8.4f',hn))
disp('  Taxes ')
disp(sprintf('    Consumption                        %8.4f',txc))
disp(sprintf('    Labor                              %8.4f',txh-se))
disp(sprintf('    Investment                         %8.4f',txx))
disp(sprintf('    Property                           %8.4f',txk))
disp(sprintf('    Profits                            %8.4f',txp))
disp(sprintf('    Dividends                          %8.4f',txd))
disp(sprintf('    TOTAL                              %8.4f',tx))
disp(sprintf('  Transfers                            %8.4f',tx-g))
