%ALTPARAMS   is used to check the sensitivity of the results in
%           
%              Technology capital and the US Current Account"
%              by Ellen McGrattan and Ed Prescott 
%
%            See the appendix for details of the model, the benchmark 
%            parameters, and alternate parameterizations. Benchmark 
%            parameters are loaded first.  Users can run their own 
%            experiments by changing the elements of vector param(.).
%

%            Ellen McGrattan, 1-20-08

%
%
benchmark
altalphI1

T=16;
T0=80;
nyr=5;
for i=1:1;

sigr     = param(19+13*T:18+14*T);
sigu     = param(19+14*T:18+15*T);
%suhn     = param(19+15*T:18+16*T);
a_sigu  = .69*.995;
b_sigu  = .121;
c_sigu  = -1.5;
d_sigu  = .045;
sigu    = a_sigu*(1+b_sigu*(tanh(c_sigu:d_sigu:c_sigu+d_sigu*(T0-1))'- ...
          tanh(c_sigu)));
sigu    = sigu(1:nyr:T0);
sigr    = .995*linspace(.835,.905,16)';

param(19+13*T:18+14*T)=sigr;
param(19+14*T:18+15*T)=sigu;
%param(19+15*T:18+16*T)=suhn;

%
% Update X and P (if needed) so that first-order conditions 
% and additional constraints hold
%
load match.dat
nyr                    = 5;
T                      = param(18);
cparam                 = [match(:,4);.31;ones(7,1)];
P0                     = param(19+16*T:26+17*T);
P1                     = secant('newPX',P0,[param;X0(:);cparam]);
[res,X1]               = newPX(P1,[param;X0(:);cparam]);
param1                 = [param(1:18+16*T);P1];

param=param1;
end;

X0                     = X1;
param                  = [param1;nyr];
results
