Problem in estimating/simulate dsge model

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Problem in estimating/simulate dsge model

Postby lin » Thu Nov 06, 2014 5:15 pm

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
Attachments
mydata1.m
(30.73 KiB) Downloaded 69 times
mysdata1.zip
(25.94 KiB) Downloaded 66 times
mydata1.mod
(8.65 KiB) Downloaded 69 times
lin
 
Posts: 8
Joined: Mon Jun 16, 2014 3:58 am

Re: Problem in estimating/simulate dsge model

Postby jpfeifer » Thu Nov 06, 2014 5:44 pm

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;
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Problem in estimating/simulate dsge model

Postby lin » Fri Nov 07, 2014 5:39 am

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
Attachments
mysdata1.zip
(25.94 KiB) Downloaded 60 times
mydata1.mod
(8.65 KiB) Downloaded 53 times
lin
 
Posts: 8
Joined: Mon Jun 16, 2014 3:58 am

Re: Problem in estimating/simulate dsge model

Postby jpfeifer » Fri Nov 07, 2014 7:55 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Problem in estimating/simulate dsge model

Postby lin » Sun Nov 09, 2014 7:08 am

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
Attachments
mydata2.zip
(29.17 KiB) Downloaded 64 times
lin
 
Posts: 8
Joined: Mon Jun 16, 2014 3:58 am

Re: Problem in estimating/simulate dsge model

Postby jpfeifer » Tue Nov 11, 2014 6:23 pm

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Problem in estimating/simulate dsge model

Postby lin » Thu Nov 13, 2014 5:36 am

Thanks so much for pointing out these mistakes.
lin
 
Posts: 8
Joined: Mon Jun 16, 2014 3:58 am

Re: Problem in estimating/simulate dsge model

Postby lin » Thu Nov 13, 2014 8:42 am

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
lin
 
Posts: 8
Joined: Mon Jun 16, 2014 3:58 am

Re: Problem in estimating/simulate dsge model

Postby jpfeifer » Fri Nov 14, 2014 6:18 am

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Problem in estimating/simulate dsge model

Postby lin » Fri Nov 14, 2014 6:47 am

Thank you, Jpfeifer.
lin
 
Posts: 8
Joined: Mon Jun 16, 2014 3:58 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 7 guests

cron