% Estimation for Chile
% Expanded specification based on estimation_tests3.inc.
% Initial values for the baseline estimated parameters are set to the posterior modes
% reported from the stable estimation run.

varobs  
        gam_C_obs 
        gam_YR_obs
        gam_I_obs
        rer_obs
        piOstar_obs
        piTGstar_obs
        piTCostar_obs
        piEC_obs
        piCEC_obs
        %pistar_obs
        R2_obs
       Rstar2_obs
        gam_xET_obs
        gam_xEHy_obs
        gam_xER_obs
       gam_W_obs
        gam_Ystar_obs
        gam_yEC_obs
        piZ_obs
        pi_obs
        xi2_obs
        gam_xTCo_obs
        gam_xTG_obs	
        gam4_xCO_obs   	
        gam4_xFO_obs   	 
        gam4_xCEC_obs      
        gam4_xFEC_obs   
 


;


estimated_params;
		// Deep parameters
		//	param		ini_val	          min 	  max 	          dist            dist_p1 	dist_p2
                        etac,            2.3343,      0.1,    	,       gamma_pdf,      0.5,    	0.25;   % Elasticity of substitution non-energy and energy consumption goods
                        etaH,            0.2206,       ,    	,       gamma_pdf,      0.5,    	0.25;
                        etaCEB,           0.5,       0.1,  0.85,      gamma_pdf,       0.5,     0.25; 
                        etaFEB,          0.2182,       0.1,    	0.85,       gamma_pdf,      0.5,    0.25;
                        etaEC,          0.7552,       ,    	,       gamma_pdf,      0.5,    0.25;
                        etaT,          1.6,       0.5,    	4,       gamma_pdf,      1.6,    0.05;
 %                       gamaT,          0.5,       0,    	,       beta_pdf,      0.5,    0.2;
 %                       gamaHy,          0.5,       0,    	,       beta_pdf,      0.5,    0.2;
 %                       gamaR,          0.5,       0,    	,       beta_pdf,      0.5,    0.2;



		// AR coefficientsET
		//	param		ini_val   min 	  max 		dist 			dist_p1 	dist_p2
                       rhoRR,      	        0.5240,    	,     	,  		beta_pdf, 		0.5,    	0.075;
                       rhopTCo,                 0.9311,     	,     	,  		beta_pdf, 		0.85, 		0.075;
                       rhopTG,                  0.9428,     	,     	,  		beta_pdf, 		0.85, 		0.075;
                       rhoPo,      	        0.9596,     	,     	,  		beta_pdf, 		0.85, 		0.075;
                       rhozEC,      	        0.7114,     	,     	,  		beta_pdf, 		0.85,    	0.075;
                      rhozT,      	        0.7675,     	,     	,  		beta_pdf, 		0.85,    	0.075;
                      rhozHy,      	        0.7196,     	,     	,  		beta_pdf, 		0.85,    	0.075;
                       rhozeta_Hy,      	0.8818,     	,     	,  		beta_pdf, 		0.85,    	0.075;
                      rhozR,      	        0.9830,     	,     	,  		beta_pdf, 		0.85,    	0.075;
                      rhozZ,      	        0.9886,     	,     	,  		beta_pdf, 		0.85,    	0.075;
                      rhom,      	        0.7,     	,     	,  		beta_pdf, 		0.7,    	0.075;
                      rhoy_star,      	        0.9678,     	,     	,  		beta_pdf, 		0.85,    	0.075;
                      rhorz,      	        0.99,     	,     	0.98,  		beta_pdf, 		0.85,    	0.05;
                      rho_uip,      	        0.85,     	,     	,  		beta_pdf, 		0.85,    	0.075;


        // Innovation std. deviations
					//	param		ini_val   min 	  max 		dist 			dist_p1 	dist_p2
            stderr eps_zeta_Hy,			   0.0046,     	,     	,   inv_gamma_pdf, 	0.01, 		0.005;
             stderr eps_pTCo,	           0.1084,     	,     	,   inv_gamma_pdf, 	0.05, 		inf;
             stderr eps_pTG,	               0.1687,     	,     	,   inv_gamma_pdf, 	0.05,	inf;
             stderr eps_pO_star,	           0.1381,     	,     	,   inv_gamma_pdf, 	0.5, 		inf;
             stderr eps_zHy,	               0.1893,     	,     	,   inv_gamma_pdf, 	0.05, 		0.05;
             stderr eps_zR,	               0.05,     	,     	,   inv_gamma_pdf, 	0.05, 		inf;
             stderr eps_zT,	               0.1826,     	,     	,   inv_gamma_pdf, 	0.05, 		inf;
             stderr eps_zEC,	               0.0135,     	,     	,   inv_gamma_pdf, 	0.05, 		inf;
            stderr eps_rz,	            0.0135,     	,     	,   inv_gamma_pdf, 	0.05, 		inf;
             stderr eps_uip,	               0.001,     	,     	,   inv_gamma_pdf, 	0.005, 		inf;
            stderr eps_m,	               0.005,     	,     	,   inv_gamma_pdf, 	0.005, 		inf;
             stderr eps_zZ,	               0.0249,     	,     	,   inv_gamma_pdf, 	0.005, 		inf;
            stderr eps_ystar,	           0.1435,     	,     	,   inv_gamma_pdf, 	0.005, 		inf;
             stderr eps_zH,	               0.0210,     	,     	,   inv_gamma_pdf, 	0.05, 		inf;


end;




estimation(datafile='data_XMAS_24Q4_energy_new_ends19q3_newnew.xlsx',
           xls_sheet=DataDemean,
           xls_range = A1:Ap80,
           mode_compute=0,
%           additional_optimizer_steps=[4],
%           mh_replic=300000,
%           mode_check,
           mode_file=nk_open_elec_LCP_mode15,
           load_mh_file,
           mh_nblocks=2,
           mh_drop=0.5,
           plot_priors=0,
           posterior_nograph,
           mh_jscale=0.35);


stoch_simul(irf=40,order=1, hp_filter=1600,nograph);
