Problem in estimating/simulate dsge model

Dear all,

I’m trying to estimate (Bayesian) & simulate the dsge model for my thesis. From here I need to produce output such impulse response function, variance decomposition etc. However, I’m facing the following problems/error messages which I’m unable to fix them. Could anyone help me or any help will be greatly appreciated, even if it’s just to point me in the right direction. I have attached the data & .mod files which I used in my analysis.

Error using check_prior_bounds (line 39)
Initial value(s) of pi_ss are outside parameter bounds. Potentially, you should set
prior_trunc=0. If you used the mode_file-option, check whether your mode-file is
consistent with the priors.

Error in dynare_estimation_init (line 273)
check_prior_bounds(xparam1,bounds,M_,estim_params_,options_,bayestopt_)

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 84)
dynare_estimation_1(var_list,dname);

Error in mydata1 (line 704)
dynare_estimation(var_list_);

Error in dynare (line 174)
evalin(‘base’,fname) ;

Thanks very much
lin
mydata1.m (30.7 KB)
mysdata1.zip (25.9 KB)
mydata1.mod (8.65 KB)

Your priors are weird. Why are you trying to truncate everything?
Look at

[quote]pi_ss,2.960,4.00,10.0,GAMMA_PDF,8.712,0.056;
[/quote]

It means that pi_ss follows a gamma distribution with mean 8.712 and standard deviation 0.056, which is truncated to the interval [4,10]. Your starting value is 2.96. As 2.96 is smaller than 4, you get the error message.
You should use

[quote]pi_ss,2.960, , ,GAMMA_PDF,8.712,0.056;
[/quote]

Dear Professor Pfeifer
Thank you for your prompt reply & I managed to fix the first problem.
However, i still couldn’t get the model up & running as there are several more problems still exist & i don’t have any idea how to fix them. I’m still new in using Dynare. The problems are listed here:

Reference to non-existent field ‘dCobs’.

Error in read_variables (line 84)
dyn_tmp_01 = s.(deblank(var_names_01(dyn_i_01,:)));

Error in initialize_dataset (line 32)
rawdata = read_variables(datafile,varobs,],xls.sheet,xls.range);

Error in dynare_estimation_init (line 477)
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 84)
dynare_estimation_1(var_list,dname);

Error in mydata1 (line 704)
dynare_estimation(var_list_);

Error in dynare (line 174)
evalin(‘base’,fname) ;

Could Professor help me out please? I attached the latest data & .mod files here

thanks very much
lin
mysdata1.zip (25.9 KB)
mydata1.mod (8.65 KB)

You are telling Dynare that you observe

but the variable in your datafile is called dCons. Naming in the datafile and the mod-file needs to be consistent.

Hi Professor Jpfeifer
i have fixed the earlier problem but the error message still exist. i couldn’t figure out what went wrong.

Error using chol
Matrix must be positive definite.

Error in metropolis_hastings_initialization (line 68)
d = chol(vv);

Error in random_walk_metropolis_hastings (line 62)
ix2, ilogpo2, ModelName, MetropolisFolder, fblck, fline, npar, nblck, nruns,
NewFile, MAX_nruns, d ] = …

Error in dynare_estimation_1 (line 799)
feval(options_.posterior_sampling_method,objective_function,options_.proposal_distribution,xparam1,invhess,bounds,dataset_,options_,M_,estim_params_,bayestopt_,oo_);

Error in dynare_estimation (line 84)
dynare_estimation_1(var_list,dname);

Error in mydata2 (line 704)
dynare_estimation(var_list_);

Error in dynare (line 174)
evalin(‘base’,fname) ;

Could you help me out please? I attached the latest data & .mod files in zipped format here.

thanks very much
lin
mydata2.zip (29.2 KB)

First of all, take a look at your data.

Thanks so much for pointing out these mistakes.

Hi Professor Pfeifer

After the data is seasonally adjusted, do we still need to demean the data before taking the log differences?

thank you
lin

That depends on your observation equation. Seasonal adjustment typically does not demean the data. If you match this data to mean 0 model variables, you need to demean them

Thank you, Jpfeifer.