added: handle NaN values in measured output ym for all state estimators#404
Merged
Conversation
This is more precise, it means that `preparestate!` was called.
NaN values in measured output ym for all state estimators.NaN values in measured output ym for all state estimators
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #404 +/- ##
=======================================
Coverage 98.71% 98.72%
=======================================
Files 27 27
Lines 5703 5722 +19
=======================================
+ Hits 5630 5649 +19
Misses 73 73 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
It is more natural to see `initstate!` first.
Most state estimator skip the correction step altogether, except `InternalModel` and `MovingHorizonEstimator`, supporting partial correction out-of-the-box. I choose to customize the warning message for each estimator types for this reason.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an alternative to #403 essentially implementing the same feature, that is, skipping the correction step when the measured outputs is not available. The advantage compared to #403 is the simplicity in the logic, and a uniform behavior for the
MovingHorizonEstimatorand all the other state estimators: simply pass aymvector withNaNvalues topreparestate!andupdatestate!when measurements are not available. Also, assigningnothingto theymargument inpreparestate!andupdatestate!functions is equivalent to a vector filled withNaNvalues.To summarize, the behavior is:
MovingHorizonEstimator: skip all theNaNvalues in the objective function.IntenalModel: assign a 0 value in the current estimated stochastic outputNaNvalues inymargument.Luenberger: skip the correction step altogether if there is at least oneNaNinymargument. Note that there are other and more refine approaches to this, but skipping the correction step is a good and simple method for this.A customize
@warnis also printed to mention explicitly what is being done to the user.This effectively implement the functionality mentioned by @baggepinnen in #89.