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_ = 'ramst';
logname_ = 'ramst.log';
diary off;
warning off;
delete ramst.log;
warning on;
warning backtrace;
diary ramst.log;

iter_ = 200;
options_.periods = 200;






global alph gam delt bet aa 

alph=0.5;
gam=0.5;
delt=0.02;
bet=0.05;
aa=0.5;


lgy_ = 'c';
lgy_ = str2mat(lgy_,'k');
lgx_ = 'x';
lgx_orig_ord_ = [1];
endo_nbr = 2;
exo_nbr = 1;
recur_nbr = 0;
iy_ = [ 0 1];
temp = [ 2 3];
iy_ = [ iy_ ; temp ];
temp = [ 4 0];
iy_ = [ iy_ ; temp ];
ykmin_ = 1;
ykmax_ = 1;
xkmin_ = 0;
xkmax_ = 1;
zkmin_ = 0;
zkmax_ = 0;
ys_ = zeros(2,1);
exe_ = zeros(1,1);


% INITVAL 
valf_ = 0;
endval_=0;
exe_(1)=1;
ys_(2)=((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
ys_(1)=aa*ys_(2)^alph-delt*ys_(2)+1;
y_=[ys_*ones(1,ykmin_)];
if exo_nbr > 0;
  ex_=[ones(xkmin_,1)*exe_'];
end;


steady(0);


check;


% (M)SHOCKS 
make_ex_;
set_shocks(0,1,1,1.2);


simul(dr_);


plot_list_ = 'c';
rplot(plot_list_, rplottype_) ;

plot_list_ = 'k';
rplot(plot_list_, rplottype_) ;

diary off
