Looping over DSGE-VAR options: dsge_prior_weight

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.

Looping over DSGE-VAR options: dsge_prior_weight

Postby Aldo » Fri Mar 24, 2017 4:53 pm

Dear all,
I want to get Marginal Density from DSGE-VAR over differents values of dsge_prior_weight = [0.5:0.25:10],
Please could you give some advice to do this?

I found some examples about looping over parameters but I didn´t find something about looping over options like dsge_prior_weight.

Thanks

Cheers

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

Re: Looping over DSGE-VAR options: dsge_prior_weight

Postby jpfeifer » Sat Mar 25, 2017 8:40 am

You would need something along the lines of
Code: Select all
global oo_
n_grid_points=5;
param_grid=linspace(0.3,0.5,n_grid_points);
options_.bayesian_irf = 0;
options_.plot_priors=0;
options_.silent_optimizer=1;
data_density=NaN(n_grid_points,1);

for par_iter=1:n_grid_points
    set_param_value('dsge_prior_weight',param_grid(par_iter));
    oo_recursive_=dynare_estimation(var_list_);
    data_density(par_iter)=oo_.MarginalDensity.LaplaceApproximation;
end
------------
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: Looping over DSGE-VAR options: dsge_prior_weight

Postby Aldo » Sat Mar 25, 2017 2:27 pm

Thanks jpfeifer,
Now I am getting this message:

WARNING: When estimating a DSGE-Var, declaring dsge_prior_weight as a parameter is deprecated. The preferred method is to do this via the dsge_var option in the estimation statement.
ERROR: If dsge_prior_weight is declared as a parameter, it must either be initialized or placed in the estimated_params block.

How could I solve this problem?
I attach my .mod and data.


Thanks in advance

Aldo
Attachments
ls.mod
(6.12 KiB) Downloaded 60 times
newmfile_peru.m
(5.82 KiB) Downloaded 59 times
Aldo
 
Posts: 56
Joined: Fri Aug 07, 2015 4:47 pm

Re: Looping over DSGE-VAR options: dsge_prior_weight

Postby jpfeifer » Sat Mar 25, 2017 3:58 pm

The attached file should work with the unstable version
Attachments
ls.mod
(6.32 KiB) Downloaded 70 times
------------
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: Looping over DSGE-VAR options: dsge_prior_weight

Postby Aldo » Sat Mar 25, 2017 6:09 pm

Thanks a lot dear jpfeifer.

Your work is very worthfull. Thanks.

Cheers

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


Return to Dynare help

Who is online

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