clear
clc

dynare model_test

valp_pos=strmatch('valp',M_.endo_names,'exact');
vale_pos=strmatch('vale',M_.endo_names,'exact');
val_pos=strmatch('val',M_.endo_names,'exact');
valp_con = oo_.dr.ys(valp_pos)+0.5*oo_.dr.ghs2(oo_.dr.inv_order_var(valp_pos));
vale_con = oo_.dr.ys(vale_pos)+0.5*oo_.dr.ghs2(oo_.dr.inv_order_var(vale_pos));
val_con = oo_.dr.ys(val_pos)+0.5*oo_.dr.ghs2(oo_.dr.inv_order_var(val_pos));

%% 
dynare model_nosb_test

valp_pos=strmatch('valp',M_.endo_names,'exact');
vale_pos=strmatch('vale',M_.endo_names,'exact');
val_pos=strmatch('val',M_.endo_names,'exact');
valp_nosb_con = oo_.dr.ys(valp_pos)+0.5*oo_.dr.ghs2(oo_.dr.inv_order_var(valp_pos));
vale_nosb_con = oo_.dr.ys(vale_pos)+0.5*oo_.dr.ghs2(oo_.dr.inv_order_var(vale_pos));
val_nosb_con = oo_.dr.ys(val_pos)+0.5*oo_.dr.ghs2(oo_.dr.inv_order_var(val_pos));


CEP_gain = (exp((1-betap)*(valp_con - valp_nosb_con))-1)*100
CEE_gain = (exp((1-betae)*(vale_con - vale_nosb_con))-1)*100
CE_gain = (exp(val_con - val_nosb_con)-1)*100

