Skip to content
Snippets Groups Projects
Commit 1479f58d authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge remote branch 'michel/master'

parents a766eec2 84aae713
No related branches found
No related tags found
No related merge requests found
function logged_prior_density = priordens(x, pshape, p6, p7, p3, p4) function logged_prior_density = priordens(x, pshape, p6, p7, p3, p4,initialization)
% Computes a prior density for the structural parameters of DSGE models % Computes a prior density for the structural parameters of DSGE models
% %
% INPUTS % INPUTS
...@@ -8,12 +8,13 @@ function logged_prior_density = priordens(x, pshape, p6, p7, p3, p4) ...@@ -8,12 +8,13 @@ function logged_prior_density = priordens(x, pshape, p6, p7, p3, p4)
% p7: [double] vector with n elements, second parameter of the prior distribution (bayestopt_.p7). % p7: [double] vector with n elements, second parameter of the prior distribution (bayestopt_.p7).
% p3: [double] vector with n elements, lower bounds. % p3: [double] vector with n elements, lower bounds.
% p4: [double] vector with n elements, upper bound. % p4: [double] vector with n elements, upper bound.
% initialization [integer] if 1: initialize persistent variables
% %
% OUTPUTS % OUTPUTS
% logged_prior_density [double] scalar, log of the prior density evaluated at x. % logged_prior_density [double] scalar, log of the prior density evaluated at x.
% %
% Copyright (C) 2003-2009 Dynare Team % Copyright (C) 2003-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -30,12 +31,10 @@ function logged_prior_density = priordens(x, pshape, p6, p7, p3, p4) ...@@ -30,12 +31,10 @@ function logged_prior_density = priordens(x, pshape, p6, p7, p3, p4)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
persistent pflag
persistent id1 id2 id3 id4 id5 id6 persistent id1 id2 id3 id4 id5 id6
persistent tt1 tt2 tt3 tt4 tt5 tt6 persistent tt1 tt2 tt3 tt4 tt5 tt6
if isempty(pflag) if nargin > 6 && initialization == 1
Number0fParameters = length(pshape);
% Beta indices. % Beta indices.
tt1 = 1; tt1 = 1;
id1 = find(pshape==1); id1 = find(pshape==1);
... ...
......
...@@ -18,7 +18,7 @@ function [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params ...@@ -18,7 +18,7 @@ function [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% None % None
% Copyright (C) 2003-2009 Dynare Team % Copyright (C) 2003-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -262,3 +262,7 @@ if exist([ M_.dname '/prior/definition.mat']) ...@@ -262,3 +262,7 @@ if exist([ M_.dname '/prior/definition.mat'])
else else
save([M_.dname '/prior/definition.mat'],'bayestopt_'); save([M_.dname '/prior/definition.mat'],'bayestopt_');
end end
% initialize persistent variables in priordens()
priordens(xparam1,bayestopt_.pshape,bayestopt_.p6,bayestopt_.p7, ...
bayestopt_.p3,bayestopt_.p4,1);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment