From 6d6174d6aeb84920cc0e0c573baf280684680b1c Mon Sep 17 00:00:00 2001 From: adjemian Date: Fri, 6 Jul 2007 14:43:00 +0000 Subject: [PATCH] Added a penalty when the bvar-dsge prior is not proper (too small values of dsge_prior_weight). git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1343 ac1d8469-bf42-47a9-8791-bf33cf982152 --- matlab/DsgeVarLikelihood.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/matlab/DsgeVarLikelihood.m b/matlab/DsgeVarLikelihood.m index b10f44cae..83ca820bc 100644 --- a/matlab/DsgeVarLikelihood.m +++ b/matlab/DsgeVarLikelihood.m @@ -103,6 +103,7 @@ M_.Sigma_e = Q; %% Weight of the dsge prior: dsge_prior_weight = M_.params(strmatch('dsge_prior_weight',M_.param_names)); + %------------------------------------------------------------------------------ % 2. call model setup & reduction program %------------------------------------------------------------------------------ @@ -142,6 +143,12 @@ NumberOfObservedVariables = size(options_.varobs,1); NumberOfLags = options_.varlag; k = NumberOfObservedVariables*NumberOfLags ; +if dsge_prior_weight<(k+NumberOfObservedVariables)/nobs; + fval = bayestopt_.penalty*min(1e3,(k+NumberOfObservedVariables)/nobs-dsge_prior_weight); + cost_flag = 0; + return; +end + TheoreticalAutoCovarianceOfTheObservedVariables = ... zeros(NumberOfObservedVariables,NumberOfObservedVariables,NumberOfLags+1); TheoreticalAutoCovarianceOfTheObservedVariables(:,:,1) = tmp(mf,mf);