clear all
global scalv_ ex_ recur_ recurs_ ys_ y_ exe_ lgy_ lgx_ lgr_ dsmpl_ endval_
 ...
global endo_nbr exo_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_
dsmpl_=0;
dynatol_=0.00001;
maxit_=10;
slowc_=1;
timing_=0;
ct_=0;
gstep_=1e-2;
endval_=0;rplottype_=0;
valf_=0;
y_=[];
ex_=[];
fname_ = 'example2';
logname_ = 'example2.log';
diary off;
warning off;
delete example2.log;
warning on;
warning backtrace;
diary example2.log;


iter_ = 20100;
options_.periods = 20100;






global beta rho beta alpha delta theta psi tau 


alpha = 0.36;
rho   = 0.95;
tau   = 0.025;
beta  = 0.99;
delta = 0.025;
psi   = 0;
theta = 2.95;

lgy_ = 'a';
lgy_ = str2mat(lgy_,'b');
lgy_ = str2mat(lgy_,'c');
lgy_ = str2mat(lgy_,'h');
lgy_ = str2mat(lgy_,'k');
lgy_ = str2mat(lgy_,'y');
lgx_ = 'e';
lgx_ = str2mat(lgx_,'u');
lgx_orig_ord_ = [1 2];
endo_nbr = 6;
exo_nbr = 2;
recur_nbr = 0;
iy_ = [ 1 2 0 0 3 0];
temp = [ 4 5 6 7 8 9];
iy_ = [ iy_ ; temp ];
temp = [ 0 10 11 0 0 12];
iy_ = [ iy_ ; temp ];
ykmin_ = 1;
ykmax_ = 1;
xkmin_ = 0;
xkmax_ = 0;
zkmin_ = 0;
zkmax_ = 0;
ys_ = zeros(6,1);
exe_ = zeros(2,1);


% INITVAL 
valf_ = 0;
endval_=0;
ys_(6)=0.1;
ys_(3)=-0.2;
ys_(4)=-1.2;
ys_(5)=2.4;
ys_(1)=0;
ys_(2)=0;
exe_(1)=0;
exe_(2)=0;
y_=[ys_*ones(1,ykmin_)];
if exo_nbr > 0;
  ex_=[ones(xkmin_,1)*exe_'];
end;


steady(0);


% (M)SHOCKS 
make_ex_;
Sigma_e_ = zeros(2,2);
Sigma_e_(1,1) = 0.009^2;
Sigma_e_(2,2) = 0.009^2;


options_.dr_algo=1;
options_.drop=200;
var_list_ = [];
stoch_simul(var_list_);


diary off
