-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Negative covariance matrix in Unscented Kalman filter #377
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
Comments
This code is very unreadable; if you have 4 spaces before each line github will transform it into valid python. I don't understand your problem construction. You have a state vector with 8 components, but only compute the first two. So the unscented transform is creating sigma points around R21, R32, etc, but your function doesn't compute new values for them. It's not surprising that the code finds negative correlations between the various values. I can't be sure, I had to guess at the meaning of the code giving the bad formatting and numerous unused variables, but that is where I would look. These are also subject to numerical instability in general, especially when your initial covariance is vastly different from the first computed covariance. It never hurts to compute P = 0.5*([email protected]) to make it positive semi-definite again. |
Hi, I don't understand the motivation for the second set of code. The KF is not estimating any parameters, hence K is meaningless, and you certainly can't apply it to parameters you are not estimating. I've only used the UKF for small dimensional problems. This post suggests that the UKF can have non-positive semidefinite covariances when the dimension is > 3. https://math.stackexchange.com/questions/796331/scaling-factor-and-weights-in-unscented-transform-ukf I'll reiterate my concern of you having 6 coefficients in the state vector which do not vary. Your covariance is negative when computing the covariance between these values. If they don't vary in the real world then they probably shouldn't be in the state vector; if they do try adding a model for how they vary. I don't think that will change the issue with high dimensionality; I'm just addressing the KF design. Wan and van der Merwe's paper suggest evaluating the covariance over I think if you make your state [T2, T3] and treat the rest as constants the UKF will work as you expect. |
Somehow this didn't get checked in for commit 91f8010. Remove dt=dt from plot_track calls.
Uh oh!
There was an error while loading. Please reload this page.
I want to implement the Unscented Kalman filter(UKF) method for the nonlinear problem; I set all initial values such as initial mean vector and initial covariance matrix. The dimension of the problem is 8. Below is the code of implementation; I do not know why the new covariance matrix at the end of the code includes some negative parameters. These negative parameters make problems for the next iteration of the approach.
The text was updated successfully, but these errors were encountered: