Skip to content

Commit

Permalink
fixing bug diffuse filter
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelJuillard committed Jan 3, 2023
1 parent 2f30b27 commit 75b54dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/kalman_filter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ function diffuse_kalman_filter_init!(Y::AbstractArray{X},
# Finf = Z*Pinf*Z'
get_F!(vFinf, vZPinf, vZsmall, vPinf)
info = get_cholF!(vcholF, vFinf)
if info > 0
if norm(vFinf) < tol || rcond(vFinf) < ws.kalman_tol
if info > 0 || rcond(vFinf) < ws.kalman_tol
if norm(vFinf) < tol
get_updated_Finfnull2!(vatt,
vPinftt,
vPstartt,
Expand All @@ -402,6 +402,7 @@ function diffuse_kalman_filter_init!(Y::AbstractArray{X},
cholHset = true
end
ws.lik[t] += ndata*l2pi + univariate_step(vatt, va1, vPinftt, vPinf1, vPstartt, vPstar1, Y, t, vc, vZsmall, vvH, vd, vT, ws.QQ, va, vPinf, vPstar, diffuse_kalman_tol, kalman_tol, ws, pattern)
t += 1
continue
end
else
Expand Down
1 change: 0 additions & 1 deletion src/kalman_likelihood.jl
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@ function diffuse_kalman_likelihood_init!(Y::Matrix{U},
# iFv = inv(F)*v
get_iFv!(ws.iFv, ws.cholF, ws.v)
ws.lik[t] = ny*log(2*pi) + log(det_from_cholesky(ws.cholF)) + LinearAlgebra.dot(ws.v, ws.iFv)
continue
else
ws.lik[t] += univariate_step(Y, t, Z, H, T, QQ, a, Pinf, Pstar, diffuse_kalman_tol, kalman_tol, ws)
end
Expand Down

0 comments on commit 75b54dd

Please sign in to comment.