clear all
 ...
global scalv_ ex_ ex_det_ recur_ recurs_ ys_ y_ exe_ exe_det_ lgy_ lgx_ lgx_det_ lgr_ dsmpl_ endval_
 ...
global endo_nbr exo_nbr exo_det_nbr iy_  ykmin_  ykmax_  xkmin_  xkmax_ zkmin_ zkmax_ iter_
 ...
global dynatol_ slowc_ maxit_ valf_ ys0_ recurs0_ ex0_ timing_ ct_ gstep_ Sigma_e_ fname_ lgx_orig_ord_ iter_ options_ dr_ oo_ trend_coeff_ eigenvalues_
global M_
M_.ex_det_length = 0;
M_.dname = 'zanetti2';
endo_nbr=0;exo_nbr=0;exo_det_nbr=0;
dsmpl_=0;
dynatol_=0.00001;
maxit_=10;
slowc_=1;
timing_=0;
ct_=0;
gstep_=1e-2;
endval_=0;rplottype_=0;
valf_=0;
y_=[];
ex_=[];
ex_det_=[];
fname_ = 'zanetti2';
logname_ = 'zanetti2.log';
diary off;
warning off;
delete zanetti2.log;
warning on;
warning backtrace;
diary zanetti2.log;
options_ = [];
lgy_ = 'c';
lgy_ = str2mat(lgy_,'d');
lgy_ = str2mat(lgy_,'g');
lgy_ = str2mat(lgy_,'n');
lgy_ = str2mat(lgy_,'p');
lgy_ = str2mat(lgy_,'r');
lgy_ = str2mat(lgy_,'w');
lgy_ = str2mat(lgy_,'x');
lgy_ = str2mat(lgy_,'y');
endo_nbr = 9;

lgx_ = 'a';
lgx_ = str2mat(lgx_,'eps_e');
lgx_orig_ord_ = [1 2];
exo_nbr = 2;


global ALPHA B BETA CHI DELTA E PHI PHIR PHIY PPHI 
global Q SIGMA SIGMAA SIGMAR THETA X 

BETA= 0.99;
SIGMA= 1.5;
PHI= 1;
CHI= .5;
DELTA= 4.5;
X= 0.43;
ALPHA= 1;
E= 1;
B= .5;
THETA= 6;
Q= 0.50;
PPHI= 1.5;
PHIY= .5;
PHIR= .32;
SIGMAR= 0.001;
SIGMAA= 0.008;

iy_ = [ 0 0 0 0 0 0 0 0 0];
ykmin_ = 0;
ykmax_ = 0;
xkmin_ = 0;
xkmax_ = 0;
zkmin_ = 0;
zkmax_ = 0;
ys_ = zeros(9,1);
exe_ = zeros(2,1);


% INITVAL 
valf_ = 0;
endval_=0;
ys_(9)=6.625;
ys_(1)=6.618;
ys_(7)=13.861;
ys_(4)=0.945;
ys_(2)=1;
exe_(1)=7;
ys_(8)=2.293;
ys_(6)=0.01;
ys_(3)=0;
y_=[ys_*ones(1,ykmin_)];
if exo_nbr > 0;
  ex_=[ones(xkmin_,1)*exe_'];
end;
if exo_det_nbr > 0;
  ex_det_=[ones(ykmin_+1,1)*exe_det_'];
end;


steady(0);

check;


% (M)SHOCKS 
make_ex_;
shocks_file(0);
Sigma_e_ = zeros(2,2);
Sigma_e_(2,2) = sterr100*SIGMAR,sterr100*SIGMAA;

save('zanetti2_results','oo_','dr_');
diary off
