Skip to content
Snippets Groups Projects
Commit 029e9495 authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Stéphane Adjemian
Browse files

Fix bug in dsge_var_likelihood.m where constant was not considered for dof...

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
parent 4486d098
Branches
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment