Hi,
I am trying to do the following example. the new is the estimation of a dsge_var model defining the dsge_prior_weight as a parameter, but it doesn't work.
// .mod file for estimating model
var pi, y, r, pie, epspi, epsy, epsr, epspie, inflobs, outputobs, ffrobs, pieobs; % endogenous variables and exogenous latent AR(1)processes
varexo eepspi, eepsy, eepsr, eepspie; % shocks
parameters beta, alpha, dsge_prior_weight, gamma, k, h, tau, phipi, phiy, phir, rhopi, rhor, rhoy, rhopie;
//initial values for the parameter vector
//quarterly data(no annualization)
//fixed/steady state parameters
beta = 0.99;
rhopi=0.6;
//structural model
alpha=1;
k=0.05;
h=0.9;
tau=0.15;
phipi=1.5;
phiy=0.25;
phir=0.9;
rhopi=0.6;
rhor=0.5;
rhoy=0.5;
rhopie=0.5;
gamma=0.5;
model;
// state space
pi=beta*(gamma*pi(1)+(1-gamma)*pie)+k*y+epspi;
y=(1/(1+h))*y(1)+(h/(1+h))*y(-1)-tau*(r-pi(1))+epsy;
pie=rhopie*pie(-1)+alpha*y(-1)+epspie;
r=(1-phir)*(phipi*pi+phiy*y)+phir*r(-1)+epsr;
epspi=rhopi*epspi(-1)+eepspi;
epsy=rhoy*epsy(-1)+eepsy;
epsr=rhor*epsr(-1)+eepsr;
epspie=rhopie*epspie(-1)+eepspie;
//measurement equation
inflobs=pi;
outputobs=y;
ffrobs=r;
pieobs=pie;
end;
steady(solve_algo=0);check;
estimated_params;
dsge_prior_weight, beta_pdf,0.5,0.4;
beta, beta_pdf, 0.4,0.1;
alpha, beta_pdf, 0.9,0.03;
gamma, beta_pdf, 0.5,0.2;
k, 0.04,gamma_pdf,0.1,0.02;
h, 0.62,beta_pdf,0.5,0.1;
tau, 0.10,gamma_pdf,0.1,0.05;
phipi,1.99, normal_pdf,1.5,0.2;
phiy,0.15,gamma_pdf,0.3, 0.2;
phir, 0.75,beta_pdf,0.5,0.2;
rhopi,0.5,beta_pdf,0.6,0.1;
rhor,0.5,beta_pdf,0.6,0.1;
rhoy,0.5,beta_pdf,0.6,0.1;
rhopie,0.5,beta_pdf,0.6,0.1;
//shocks,stdevs
stderr eepspi,0.10,inv_gamma_pdf,0.3,2;
stderr eepsy,0.50,inv_gamma_pdf,0.3,2;
stderr eepsr,0.22,inv_gamma_pdf,0.3,2;
stderr eepspie,0.25,inv_gamma_pdf,0.3,2;
end;
varobs inflobs outputobs ffrobs pieobs;//
//sample: 1982q1-2012q2
estimation(datafile=fyhu4_data,prefilter=1,first_obs=1, mode_compute=4,mode_check,mh_replic=0);% ycbo seems to work better
estimation(datafile=fyhu4_data,prefilter=1,first_obs=1,conf_sig=0.90,mh_nblocks=5,mh_jscale=0.2,mh_drop=0.5,mode_compute=4,mode_check,bayesian_irf,filtered_vars,forecast=40,mh_replic=200000); % ycbo seems to work better
The response of Matlab is:
VarSampleMoments :: not enough data to initialize! Try to increase FirstObservation.
Error using +
Matrix dimensions must agree.
Error in dsge_var_likelihood (line 200)
tmp0 =
dsge_prior_weight*DynareDataset.info.ntobs*TheoreticalAutoCovarianceOfTheObservedVariables(:,:,1)
+ mYY ;
Error in initial_estimation_checks (line 47)
[fval,junk1,junk2,a,b,c,d] =
feval(objective_function,xparam1,DynareDataset,DynareOptions,Model,EstimatedParameters,BayesInfo,DynareResults);
Error in dynare_estimation_1 (line 179)
oo_ =
initial_estimation_checks(objective_function,xparam1,dataset_,M_,estim_params_,options_,bayestopt_,oo_);
Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);
Error in an (line 230)
dynare_estimation(var_list_);
Error in dynare (line 180)
evalin('base',fname) ;