Do not compute cholesky decomposition of H if the matrix has zeros on
the diagonal.
time-shift
Stéphane Adjemian (Charybdis) 2021-01-16 11:21:14 +01:00
parent ad17b8ec33
commit 38e300b94e
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
1 changed files with 9 additions and 5 deletions

View File

@ -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)<length(DynareOptions.varobs)
error('initial_estimation_checks:: particle filtering requires as many measurement errors as observed variables')
else
[~,flag]=chol(Model.H);
if flag
error('initial_estimation_checks:: the measurement error matrix must be positive definite')
end
end
end
end