Hi, I am trying to work with dynare. My file mod is the following
// .mod file for estimating model
var pi, y, r, u, epspi, epsr, epsy, epsu, inflobs, outputobs, ffrobs, uobs; % endogenous variables and exogenous latent AR(1)processes
varexo eepspi, eepsy, eepsr, eepsu; % shocks
parameters beta, alpha, k, h, tau, phipi, phiy, phir, rhopi, rhor, rhoy, rhou;
//initial values for the parameter vector
//quarterly data(no annualization)
//fixed/steady state parameters
beta = 0.99;
rhopi=0.6;
//structural model
alpha=0.99;
h=0.9;
k=0.1;
tau=0.15;
phipi=1.5;
phiy=0.25;
phir=0.9;
rhopi=0.6;
rhor=0.5;
rhoy=0.5;
rhou=0.1;
model;
// state space
pi=beta*pi(1)+k*y+u+epspi;
y=(1/(1+h))*y(1)+(h/(1+h))*y(-1)-tau*(r-pi(1))+epsy;
r=(1-phir)*(phipi*pi+phiy*y)+phir*r(-1)+epsr;
u=rhou*u(-1)+alpha*y+epsu;
epspi=rhopi*epspi(-1)+eepspi;
epsy=rhoy*epsy(-1)+eepsy;
epsr=rhor*epsr(-1)+eepsr;
epsu=rhou*epsu(-1)+eepsu;
//measurement equation
inflobs=pi;
outputobs=y;
ffrobs=r;
uobs=u;
end;
steady(solve_algo=0);check;
estimated_params;
beta, beta_pdf, 0.4,0.1;
alpha, beta_pdf, 0.9,0.03;
k, 0.04,0.001,1,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;
rhou,0.5,beta_pdf,0.6,0.1;
// shocks, stdevs
stderr eepspi,0.10,inv_gamma_pdf,0.3,3;
stderr eepsy,0.50,inv_gamma_pdf,0.3,3;
stderr eepsr,0.22,inv_gamma_pdf,0.3,3;
stderr eepsu,0.25,inv_gamma_pdf,0.3,3;
end;
varobs inflobs outputobs ffrobs uobs;//
//sample: 1982q1-2012q2
estimation(datafile=fyhu1_data,prefilter=1,first_obs=1, mode_compute=4,mode_check,mh_replic=0);% ycbo seems to work better
estimation(datafile=fyhu1_data,prefilter=1,first_obs=1,mh_jscale=0.65,mh_drop=0.05,mode_compute=4,mh_nblocks=2,bayesian_irf,filtered_vars,conf_sig=0.90,mh_replic=200000); % ycbo seems to work better
BUT, the only grafics shows are the priors and then the respose of Matlab is the sequence:
You did not declare endogenous variables after the estimation/calib_smoother command.
Error using fyhu1_data (line 1)
Error using vertcat
Dimensions of matrices being concatenated are not consistent.
Error in read_variables (line 72)
eval(basename);
Error in initialize_dataset (line 32)
rawdata = read_variables(datafile,varobs,[],xls.sheet,xls.range);
Error in dynare_estimation_init (line 471)
dataset_ =
initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls);
Error in dynare_estimation_1 (line 81)
[dataset_,xparam1, hh, M_, options_, oo_, estim_params_,bayestopt_] =
dynare_estimation_init(var_list_, dname, [], M_, options_, oo_,
estim_params_, bayestopt_);
Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);
Error in fusa1 (line 220)
dynare_estimation(var_list_);
Error in dynare (line 180)
evalin('base',fname) ;
Error in read_variables (line 72)
eval(basename);
Error in initialize_dataset (line 32)
rawdata = read_variables(datafile,varobs,[],xls.sheet,xls.range);
Error in dynare_estimation_init (line 471)
dataset_ =
initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls);
Error in dynare_estimation_1 (line 81)
[dataset_,xparam1, hh, M_, options_, oo_, estim_params_,bayestopt_] =
dynare_estimation_init(var_list_, dname, [], M_, options_, oo_,
estim_params_, bayestopt_);
Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);
Error in fusa1 (line 220)
dynare_estimation(var_list_);
Error in dynare (line 180)
evalin('base',fname) ;
I can not find where is the problem. I need some help.Thanks