clc; clear;
global oo_ M_ options_ 

dynare Rec1.mod; 

%------------------------estimation----------------------------------------
order_a=1;order_c=2;order_k=3;order_v=4; order_vk=5;
dyn.c = oo_.dr.inv_order_var(order_c);

x0 = [0.97,1.5]; %BETTA and GAM
targetMom = [0.01869]; % mean of cons. growth.
shockMat = (oo_.exo_simul)';
ytest=Objfn(x0,targetMom,shockMat,dyn);
%[est1,fval,exitflag,output] = patternsearch({@Objfn,targetMom,shockMat,dyn},x0,[],[],[],[],[0.0,0.0],[2.0,Inf],[]);
