Nov 16, 2008 18:11
i have to explain why i am so frustrated working on this filter code.
i have two filters, the unscented and the extended filter. both come in continuous and discrete versions, and i'm trying to compare the performance of the filters on different models -- eg does the discrete filter paired with a pre-discretized system work better than a continuous filter paired with a continuous model and then sampled after the fact. obviously, this requires four separate filter codes, each slightly different from one another.
well, these filters have personalities and their failure modes are very hard to understand. sometimes, you may just need to use more data, or a smaller step size. or you may just have to tune the three covariance matrices, or the initial iterate. these are easy tweaks, but the failures that result from these look precisely like larger, more significant, logic errors in the code. perhaps most frustrating is the notation in the papers that is inconsistent, poorly explained, or just damn wrong.
i've been at this coffee shop for the last six hours coding this stuff up. i got so lost in the code that i just ax'd everything and started over, in a much cleaner and smoother way. i'm using the inv() command to take the explicit inverse of a matrix instead of solving the associated linear system. it's bad numerics, buts it so damn easy and all of my matrices are well conditioned that i'm aware of. dr. chu would kill me if he knew, but once i get this code stable i can add features.
i am on the last, most difficult code now -- the unscented kalman bucy filter. all of our models are continuous time models (duh) so its important to understand how pre and post discretization affects the convergence results.
and that is why i'm so frustrated.