Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Joseph form of covariance calculation to Kalman Updater #1028

Merged
merged 3 commits into from
May 29, 2024

Conversation

csherman-dstl
Copy link
Contributor

Add the implementation of Joseph form of covariance to the Kalman Updater (as implemented in the Bayesian Recursive Updater).
Fix error arising when using Joseph form of covariance in BRUF with no measurement model.
Add tests.

@csherman-dstl csherman-dstl requested a review from a team as a code owner May 28, 2024 14:53
@csherman-dstl csherman-dstl requested review from jswright-dstl and akenyon and removed request for a team May 28, 2024 14:53
Copy link

codecov bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.59%. Comparing base (13f7578) to head (e4ec38a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1028      +/-   ##
==========================================
+ Coverage   93.58%   93.59%   +0.01%     
==========================================
  Files         203      203              
  Lines       13115    13123       +8     
  Branches     2678     2679       +1     
==========================================
+ Hits        12274    12283       +9     
- Misses        591      592       +1     
+ Partials      250      248       -2     
Flag Coverage Δ
integration 65.89% <18.75%> (-0.04%) ⬇️
unittests 89.24% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 218 to 227
return post_cov.view(CovarianceMatrix), kalman_gain

else:
kalman_gain = hypothesis.measurement_prediction.cross_covar @ \
np.linalg.inv(hypothesis.measurement_prediction.covar)

post_cov = hypothesis.prediction.covar - kalman_gain @ \
hypothesis.measurement_prediction.covar @ kalman_gain.T

return post_cov.view(CovarianceMatrix), kalman_gain
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return post_cov.view(CovarianceMatrix), kalman_gain
else:
kalman_gain = hypothesis.measurement_prediction.cross_covar @ \
np.linalg.inv(hypothesis.measurement_prediction.covar)
post_cov = hypothesis.prediction.covar - kalman_gain @ \
hypothesis.measurement_prediction.covar @ kalman_gain.T
return post_cov.view(CovarianceMatrix), kalman_gain
else:
kalman_gain = hypothesis.measurement_prediction.cross_covar @ \
np.linalg.inv(hypothesis.measurement_prediction.covar)
post_cov = hypothesis.prediction.covar - kalman_gain @ \
hypothesis.measurement_prediction.covar @ kalman_gain.T
return post_cov.view(CovarianceMatrix), kalman_gain

@sdhiscocks sdhiscocks merged commit 279f8a5 into main May 29, 2024
10 checks passed
@sdhiscocks sdhiscocks deleted the add_joseph_covariance branch May 29, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants