Page 1 of 1

Problem in estimating/simulate dsge model

PostPosted: Thu Nov 06, 2014 5:15 pm
by lin
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

Re: Problem in estimating/simulate dsge model

PostPosted: Thu Nov 06, 2014 5:44 pm
by jpfeifer
Your priors are weird. Why are you trying to truncate everything?
Look at
pi_ss,2.960,4.00,10.0,GAMMA_PDF,8.712,0.056;

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
pi_ss,2.960, , ,GAMMA_PDF,8.712,0.056;

Re: Problem in estimating/simulate dsge model

PostPosted: Fri Nov 07, 2014 5:39 am
by lin
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

Re: Problem in estimating/simulate dsge model

PostPosted: Fri Nov 07, 2014 7:55 am
by jpfeifer
You are telling Dynare that you observe
Code: Select all
dCobs

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

Re: Problem in estimating/simulate dsge model

PostPosted: Sun Nov 09, 2014 7:08 am
by lin
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

Re: Problem in estimating/simulate dsge model

PostPosted: Tue Nov 11, 2014 6:23 pm
by jpfeifer
First of all, take a look at your data.

- The national account data seems to have a massive seasonal pattern. You need to seasonally adjust your data. See Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf

- Inflation seems to be measured as the deviation of the gross inflation rate from its steady state TIMES 100, but for the interest rate you use the deviation of the gross interest rate from its steady state NOT TIMES 100. This is inconsistent if do you not account for the difference. Again, see Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf

Re: Problem in estimating/simulate dsge model

PostPosted: Thu Nov 13, 2014 5:36 am
by lin
Thanks so much for pointing out these mistakes.

Re: Problem in estimating/simulate dsge model

PostPosted: Thu Nov 13, 2014 8:42 am
by lin
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

Re: Problem in estimating/simulate dsge model

PostPosted: Fri Nov 14, 2014 6:18 am
by jpfeifer
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

Re: Problem in estimating/simulate dsge model

PostPosted: Fri Nov 14, 2014 6:47 am
by lin
Thank you, Jpfeifer.