Skip to content

Commit 8383d07

Browse files
committed
changed: small eps() term instead of pinv for MHE inversion
1 parent 1aee930 commit 8383d07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/estimator/mhe/execute.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ function invert_cov!(estim::MovingHorizonEstimator, P̄)
481481
estim.invP̄ .= inv(P̄)
482482
catch err
483483
if err isa SingularException
484-
@warn("Arrival covariance not invertible: using pseudo-inverse")
485-
estim.invP̄ .= pinv(P̄)
484+
@warn("Arrival covariance is singular: adding small regularization term")
485+
estim.invP̄ .= inv(P̄ + eps()*I)
486486
else
487487
rethrow(err)
488488
end

0 commit comments

Comments
 (0)