

				estimation(	datafile=data_XMAS_17Q2,
							xls_sheet=DataDemean,
							//endogenous_prior,
							//prior_trunc=0,
							//first_obs=2,
							nobs=[4:64],
							plot_priors=0,
							lyapunov=doubling,
							//prior_trunc=1e-64
							//mode_check,
							mode_compute = 0,
							mode_file = XMAS_mh_mean,
							kalman_algo=1, fast_kalman_filter,
							//optim=('TolFun',1e-5),
							mh_replic=0,
							mh_jscale=0.185,
							mh_drop=0.5,
							mh_nblocks=1,
							//mcmc_jumping_covariance = prior_variance,
							//smoother,
							//filter_step_ahead=[1 4 8],
							//prior_trunc=0,
							forecast=8
							)  
						
						piZ_obs gam_YR_obs gam_YCo_obs gam_I_obs gam_C_obs gam_CG_obs gam_HN_obs gam_WN_obs R_obs rer_obs stb_obs xi_obs piA_obs gam_ICo_obs gam_N_obs piO_obs gam_IG_obs gam_H_obs

						;  


	// Historical decomposition ------------------------------------------------------------

    shock_groups(name=group1);
    'Supply'	= eps_a,eps_z,eps_zA,eps_zCo;
    'Demand' 	= eps_varrho,eps_varomega,eps_varomegaCo;
    'Policy' 	= eps_eR,eps_xiIG,eps_xiCG,eps_xiTR,eps_xiO;
    'Foreign' 	= eps_xistar,eps_Rstar,eps_zetao,eps_zetau,eps_zstar,eps_xiCostar,eps_xiOstar,eps_piFstar,eps_xiMstar;
    @#if search
	'Labor' 	= eps_kappa,eps_rhox;
	@#endif
	
    end;
    %shock_decomposition(use_shock_groups=group1,nograph) gam_Y_obs gam_YR_obs gam_C_obs pi_obs piZ_obs R_obs rer_obs u hn w h;
   % plot_shock_decomposition(use_shock_groups=group1,write_xls) gam_Y_obs gam_YR_obs gam_C_obs pi_obs piZ_obs R_obs rer_obs u hn w h;

 
	 shock_groups(name=fstar_group);
     'fstar'	= eps_piFstar;
     'pistar' 	= eps_xistar;
     'Ostar' 	= eps_xiOstar;
     'Costar' 	= eps_xiCostar;
     'Mstar' 	= eps_xiMstar;
	 'UIP' 	    = eps_zetao,eps_zetau;
     end;
	 
	 shock_groups(name=rer_group);
     'fstar'	= eps_piFstar;
     'Other Prices'= eps_xistar,eps_xiOstar,eps_xiCostar,eps_xiMstar;
     'Rstar' 	= eps_Rstar;
     'R' 	    = eps_eR;
	 'UIP' 	    = eps_zetao,eps_zetau;
     end;


	 // shock_decomposition(use_shock_groups=fstar_group) piFstar fstar piCostar_obs pCostar_obs piOstar_obs pOstar_obs pistar_obs piMstar_obs pMstar;
     //shock_decomposition(use_shock_groups=rer_group) rer piS;


	// Simulation commands -----------------------------------------------------------------
	
	stoch_simul(order=1, periods=0, irf=80,nofunctions, nograph)
		//@#for vars in obs_vars_base + obs_vars_search
		//	@{vars}
		//@#endfor
		;		
	//stoch_simul(order=1,periods=0,conditional_variance_decomposition=[1 4 8],irf=80,nofunctions,nograph); 
	//stoch_simul(order=1,periods=2000,hp_filter=1600,irf=40,nograph);   


