From 38c71762063a3198586854a8f53164dbd01813fa Mon Sep 17 00:00:00 2001 From: stepan Date: Thu, 4 Jun 2009 13:15:11 +0000 Subject: [PATCH] Bug fix. Call to compute_prior_mode was buggy for gamma and beta densities (lower and upper bound were missing). git-svn-id: https://www.dynare.org/svn/dynare/trunk@2721 ac1d8469-bf42-47a9-8791-bf33cf982152 --- matlab/set_prior.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matlab/set_prior.m b/matlab/set_prior.m index 938592f33..c661c8620 100644 --- a/matlab/set_prior.m +++ b/matlab/set_prior.m @@ -152,7 +152,7 @@ function [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params stdd = bayestopt_.p2(k(i))/(bayestopt_.p4(k(i))-bayestopt_.p3(k(i))); bayestopt_.p6(k(i)) = (1-mu)*mu^2/stdd^2 - mu ; bayestopt_.p7(k(i)) = bayestopt_.p6(k(i))*(1/mu-1) ; - m = compute_prior_mode([ bayestopt_.p6(k(i)) , bayestopt_.p7(k(i)) ],1); + m = compute_prior_mode([ bayestopt_.p6(k(i)) , bayestopt_.p7(k(i)) , bayestopt_.p3(k(i)) , bayestopt_.p4(k(i)) ],1); if length(m)==1 bayestopt_.p5(k(i)) = m; else @@ -171,7 +171,7 @@ function [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params mu = bayestopt_.p1(k(i))-bayestopt_.p3(k(i)); bayestopt_.p7(k(i)) = bayestopt_.p2(k(i))^2/mu ; bayestopt_.p6(k(i)) = mu/bayestopt_.p7(k(i)) ; - bayestopt_.p5(k(i)) = compute_prior_mode([ bayestopt_.p6(k(i)) , bayestopt_.p7(k(i)) ], 2) ; + bayestopt_.p5(k(i)) = compute_prior_mode([ bayestopt_.p6(k(i)) , bayestopt_.p7(k(i)) , bayestopt_.p3(k(i)) ], 2) ; end % truncation parameters by default for normal distribution @@ -186,7 +186,7 @@ function [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params bayestopt_.p5(k(i)) = bayestopt_.p1(k(i)) ; end - % inverse gamma distribution + % inverse gamma distribution (type 1) k = find(bayestopt_.pshape == 4); k1 = find(isnan(bayestopt_.p3(k))); k2 = find(isnan(bayestopt_.p4(k)));