From 029e9495ba07792b6ed70dcfa8e97a50f464759b Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Mon, 13 Jun 2016 14:45:28 +0200 Subject: [PATCH] Fix bug in dsge_var_likelihood.m where constant was not considered for dof when Gamma function was computed Does not affect the maximum of the posterior as it only affects constant term --- matlab/dsge_var_likelihood.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matlab/dsge_var_likelihood.m b/matlab/dsge_var_likelihood.m index 4e10d0bb2..1348e5d6b 100644 --- a/matlab/dsge_var_likelihood.m +++ b/matlab/dsge_var_likelihood.m @@ -248,10 +248,10 @@ if ~isinf(dsge_prior_weight)% Evaluation of the likelihood of the dsge-var model PHI_tilde = tmp2*tmp1'; %formula (28), DS (2004) clear('tmp1'); prodlng1 = sum(gammaln(.5*((1+dsge_prior_weight)*NumberOfObservations- ... - NumberOfObservedVariables*NumberOfLags ... + NumberOfParameters ... +1-(1:NumberOfObservedVariables)'))); %last term in numerator of third line of (A.2), DS (2004) prodlng2 = sum(gammaln(.5*(dsge_prior_weight*NumberOfObservations- ... - NumberOfObservedVariables*NumberOfLags ... + NumberOfParameters ... +1-(1:NumberOfObservedVariables)'))); %last term in denominator of third line of (A.2), DS (2004) %Compute minus log likelihood according to (A.2), DS (2004) lik = .5*NumberOfObservedVariables*log(det(dsge_prior_weight*NumberOfObservations*GXX+mXX)) ... %first term in numerator of second line of (A.2), DS (2004)