DsgeVarLikelihood of Dynare 4.0.0 vs. Inestable Version

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.

DsgeVarLikelihood of Dynare 4.0.0 vs. Inestable Version

Postby Aldo » Sat May 13, 2017 6:18 pm

I am using codes written by Tim Robinson to compute forecast error (RMSE), in Dynare 4.0.0, especifically the DsgeVarLikelihood function:

[fval, cost_flag, info, PHI_STACKED, SIGMA, iXX] = DsgeVarLikelihood(xparam1, gend)

where:

xparam1 : value of vector of estimated parameters
gend : Number of observations in the sample


I would like to use the unstable version of Dynare because it is faster than Dynare 4.0.0, but in this last I get this error:

Error using dsge_var_likelihood (line 80)
Not enough input arguments.

Could you please help me to use the dsge_var_likelihood function and define inputs in the inestable version?

Also, I have another question, when I invoke options_.nobs in inestable version I get a different value of the 4.0.0 version.

Thanks in advance

Aldo
Aldo
 
Posts: 56
Joined: Fri Aug 07, 2015 4:47 pm

Re: DsgeVarLikelihood of Dynare 4.0.0 vs. Inestable Version

Postby jpfeifer » Sun May 14, 2017 10:39 am

In the unstable version, the syntax is
Code: Select all
[fval,info,exit_flag,grad,hess,SteadyState,trend_coeff,PHI_tilde,SIGMA_u_tilde,iXX,prior] =dsge_var_likelihood(xparam1,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_)

where most of the inputs come from the call to
Code: Select all
[dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_, bayestopt_, bounds] = ...
    dynare_estimation_init(var_list_, dname, [], M_, options_, oo_, estim_params_, bayestopt_);


Regarding your second question: what exactly do you mean? I would need more details
------------
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: DsgeVarLikelihood of Dynare 4.0.0 vs. Inestable Version

Postby Aldo » Mon May 15, 2017 2:59 am

Thanks jpfeifer,

1. About the last question, I mean when I run my .mod I get options_.nobs = 32 in unstable version, which is size of my data,
but in 4.4.3 and previous versions I get options_.nobs = 28.

2. By other side, when I try to use dsge_var_likelihood function running this:

Code: Select all
   dynare mymod   

   options_.first_obs = 5;
   options_.nobs = NaN;
   [dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_, bayestopt_, bounds] = ...
   dynare_estimation_init(var_list_, [], [], M_, options_, oo_, estim_params_, bayestopt_);


   [fval,info,exit_flag,grad,hess,SteadyState,trend_coeff,PHI_tilde,SIGMA_u_tilde,iXX,prior] = ...
    dsge_var_likelihood(xparam1,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_);


I get size(PHI_tilde,1) = 20. But It should be 10 (=5x2) because I have five observable variables and I set

Code: Select all
options_.varlag = 2;


3. What would be the rigth form to loop over
Code: Select all
dsge_prior_weight
option and over sample size to get PHI_tilde and SIGMA_u_tilde. I loop over dsge_prior_weight in a .mod and I loop over sample size in a .m file. But I see when I loop in a .mod (over dsge_prior_weight) dynare estimates twice, it makes slow this method, because in each iteration I run my .mod and after I run dynare_estimation(var_list_). I attach my files.
Attachments
question.rar
Draft of my codes
(17.35 KiB) Downloaded 46 times
Aldo
 
Posts: 56
Joined: Fri Aug 07, 2015 4:47 pm

Re: DsgeVarLikelihood of Dynare 4.0.0 vs. Inestable Version

Postby jpfeifer » Wed May 17, 2017 11:43 am

1- That is a matter of the changed internal treatment. In 4.4.3 nobs deducted the options_.first_obs. But that should not affect the results.
2. You are setting the wrong option for the lag number. It should be
Code: Select all
options_.dsge_varlag

Thus, you are still at the default of 4.
3. You should be able to change the prior weight within a loop via
Code: Select all
set_param_value('dsge_prior_weight',1)
------------
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


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 11 guests