% settings
clear all
close all
clc

% in case the CE toolbox is not in the global Matlab path, we add it here
try addpath('/Users/op3563/Dropbox/NewProject_2020/JMCB_Final_Submission/ReplicationMaterial_OnlineAppendix/Model\CEtools'); catch err; end


constants = struct;
constants.flag_zlb  = 1;
constants.flag_re   = 0; 
constants.sig_rn    =  0.002940;
constants.sig_u = 0.154/100;



vec_rnat = 1;
vec_gamma = [0.05,.1,.2,.3]


for i = 1:length(vec_gamma)


    constants.rnat = vec_rnat;
    constants.gamma = vec_gamma(i);

    constants_re = constants;
    constants_re.flag_re = 1;
    solve(constants_re);
    [wf(i),wf_alt(i)] = simulate(constants_re);
    [vec_epi_em_pp(i,1),vec_pi_em_pp(i,1), vec_i_em_pp(i,1), vec_r_em_pp(i,1), vec_ygap_em_pp(i,1), ...
        vec_zlb_freq_pp(i,1), vec_gap_pp(i,1), vec_avg_length_zlb(i,1),vec_u_em_pp(i,1),vec_sd_u_em_pp(i,1),sd_pi(i),sd_ygap(i),loss(i),pi_rho(i),sd_epi(i)] = get_means(constants_re);


end




vec_pi_em_pp
loss

