From 38e300b94e04f8bc2f16a79a32739bfd169c9c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Sat, 16 Jan 2021 11:21:14 +0100 Subject: [PATCH] Merge #1786. Do not compute cholesky decomposition of H if the matrix has zeros on the diagonal. --- matlab/initial_estimation_checks.m | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/matlab/initial_estimation_checks.m b/matlab/initial_estimation_checks.m index c1bc6a0dc..bec9b41ba 100644 --- a/matlab/initial_estimation_checks.m +++ b/matlab/initial_estimation_checks.m @@ -41,7 +41,7 @@ function DynareResults = initial_estimation_checks(objective_function,xparam1,Dy %singularity check maximum_number_non_missing_observations=max(sum(~isnan(DynareDataset.data),2)); -if DynareOptions.order>1 +if DynareOptions.order>1 if any(any(isnan(DynareDataset.data))) error('initial_estimation_checks:: particle filtering does not support missing observations') end @@ -54,9 +54,13 @@ if DynareOptions.order>1 if Model.H==0 error('initial_estimation_checks:: particle filtering requires measurement error on the observables') else - [~,flag]=chol(Model.H); - if flag - error('initial_estimation_checks:: the measurement error matrix must be positive definite') + if sum(diag(Model.H)>0)