From 2ee32205b261b5f94a216c8c9767da5389ec4a0d Mon Sep 17 00:00:00 2001 From: Marco Ratto <marco.ratto@jrc.ec.europa.eu> Date: Fri, 25 Sep 2015 18:47:17 +0200 Subject: [PATCH] Bug fix for odd Nc --- matlab/mcmc_ifac.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/matlab/mcmc_ifac.m b/matlab/mcmc_ifac.m index bc7be30c43..38ed34ee90 100644 --- a/matlab/mcmc_ifac.m +++ b/matlab/mcmc_ifac.m @@ -30,6 +30,9 @@ function Ifac = mcmc_ifac(X, Nc) % along with Dynare. If not, see <http://www.gnu.org/licenses/>. Nc = min(Nc, length(X)/2); +if mod(Nc,2), + Nc=Nc-1; +end AcorrXSIM = autocorr(X(:), Nc); % %Calculate the Parzen Weight -- GitLab