Thread: [Bayes++] Bayes++ w/EKF and a non-linear equation: How to model?
Brought to you by:
mistevens
From: Michael S. <ms...@21...> - 2006-12-11 16:25:35
|
Hello, everyone. I am attempting to use the Covariance_filter as an EKF for a non-linear model. However, I do not understand which type of model class to use, and how to specify the data for the models, even after looking at the Bayesian Filtering overview. I'm pretty sure I need to use a linrz_predict_model (or something like that) but beyond that... The main problem is that the elements of the f function I want to use for the model are exponential. It's non-linear, with noise, but no control (it's essentially 'the object I'm trying to predict is walking around randomly, but within the laws of physics') How do you specify that? I've been looking at the Welch and Bishop introduction and trying to compare back to Bayes++, but with no avail. I'm fairly sure I could use the libraries if my model was linear, but I don't quite see how to put the non-linearity in there. The documentation doesn't make it completely clear what all the pieces that I'm specifying are. Is there any help anyone could offer? Thanks, Mike Simon |
From: Michael S. <ma...@mi...> - 2006-12-12 21:00:30
|
On Monday, 11. December 2006 17:24, Michael Simon wrote: > Hello, everyone. > > I am attempting to use the Covariance_filter as an EKF for a non-linear > model. However, I do not understand which type of model class to use, > and how to specify the data for the models, even after looking at the > Bayesian Filtering overview. I'm pretty sure I need to use a > linrz_predict_model (or something like that) but beyond that... 'Linrz_predict_model' is definately what you want. > The main problem is that the elements of the f function I want to use > for the model are exponential. It's non-linear, with noise, but no > control (it's essentially 'the object I'm trying to predict is walking > around randomly, but within the laws of physics') How do you specify > that? No-control is fine. Control inputs just make the implementation more complex! I don't understand how you model can be 'exponential' when the physics are of something moving around at random. Or do you mean that you have exponentially correlated noise in you model? > I've been looking at the Welch and Bishop introduction and trying > to compare back to Bayes++, but with no avail. I'm fairly sure I could > use the libraries if my model was linear, but I don't quite see how to > put the non-linearity in there. I not sure of where you are stubling. Would it be possible to post the equations that model your system? The Covariance_filter implements the EKF in a fairly standard form. It should be usable for any non-linear problem that can be solved by an EKF. You need to turn the maths of you model into 3 things: f(x) : This should be easy once you have discrete time state equation of the system! Fx : Is the Jacobian of f(x) GqG' : This is often written as the symmetric matrix Q and is the covariance of the addative noise in you discrete state equations. Generally it is possible (an physically more meaningful) to write this a coupling matrix G and an noise variance q. If this is not possible then you can numerically obtain G and q from Q with the following: // Equivalent de-correlated form as GqG' Float rcond = Bayesian_filter_matrix::UdUfactor (Qtemp, Q); rclimit.check_PSD(rcond, "decorrelating Q not PSD"); Bayesian_filter_matrix::UdUseperate (G, q, Qtemp); Hope this helps you in the right direction, Michael -- ___________________________________ Michael Stevens Systems Engineering 34128 Kassel, Germany Phone/Fax: +49 561 5218038 Navigation Systems, Estimation and Bayesian Filtering http://bayesclasses.sf.net ___________________________________ |
From: Michael S. <ms...@21...> - 2006-12-12 21:42:26
|
Michael Stevens wrote: > On Monday, 11. December 2006 17:24, Michael Simon wrote: >> Hello, everyone. >> >> I am attempting to use the Covariance_filter as an EKF for a non-linear >> model. However, I do not understand which type of model class to use, >> and how to specify the data for the models, even after looking at the >> Bayesian Filtering overview. I'm pretty sure I need to use a >> linrz_predict_model (or something like that) but beyond that... > > 'Linrz_predict_model' is definately what you want. > >> The main problem is that the elements of the f function I want to use >> for the model are exponential. It's non-linear, with noise, but no >> control (it's essentially 'the object I'm trying to predict is walking >> around randomly, but within the laws of physics') How do you specify >> that? > > No-control is fine. Control inputs just make the implementation more complex! > I don't understand how you model can be 'exponential' when the physics are of > something moving around at random. Or do you mean that you have exponentially > correlated noise in you model? Actually, after sketching the algorithms out by hand, I don't understand it either. ;) I do want a model that would be sufficient to track something that might move at random, but the formula I had down clearly wouldn't give it. >> I've been looking at the Welch and Bishop introduction and trying >> to compare back to Bayes++, but with no avail. I'm fairly sure I could >> use the libraries if my model was linear, but I don't quite see how to >> put the non-linearity in there. > > I not sure of where you are stubling. Would it be possible to post the > equations that model your system? As I mentioned above, I was using the wrong formulas. At the time I was reading a report about EKF that purported to be using unconstrained Brownian Motion for modeling and trying to reproduce their results, but the formulas they gave don't produce anything approaching that, at least, not how I read them. (One example: x_k = exp(-1/4(x_(k-1) + 1.5 (deltax_(k-1)) from http://page.mi.fu-berlin.de/~zaldivar/files/tr-b-05-12.pdf ) > The Covariance_filter implements the EKF in a fairly standard form. It should > be usable for any non-linear problem that can be solved by an EKF. > You need to turn the maths of you model into 3 things: > f(x) : This should be easy once you have discrete time state equation of the > system! I suppose this is where my biggest problem was when the question was asked, but after some rooting through the code, I am under the impression you are supposed to replace the virtual f function with a function that takes x, computes f(x), computes the Jacobian for that time step and puts it in Fx, and returns the new value. Is that correct? > Fx : Is the Jacobian of f(x) > GqG' : This is often written as the symmetric matrix Q and is the covariance > of the addative noise in you discrete state equations. Generally it is > possible (an physically more meaningful) to write this a coupling matrix G > and an noise variance q. If this is not possible then you can numerically > obtain G and q from Q with the following: > > // Equivalent de-correlated form as GqG' > Float rcond = Bayesian_filter_matrix::UdUfactor (Qtemp, Q); > rclimit.check_PSD(rcond, "decorrelating Q not PSD"); > Bayesian_filter_matrix::UdUseperate (G, q, Qtemp); The two above things are simply variables to be set, yes? > > Hope this helps you in the right direction, > Michael Yes, this has been helpful so far, thanks. Michael S. |
From: Michael S. <ma...@mi...> - 2006-12-17 18:48:34
|
On Tuesday, 12. December 2006 22:41, Michael Simon wrote: > Michael Stevens wrote: > > On Monday, 11. December 2006 17:24, Michael Simon wrote: > >> Hello, everyone. > >> > >> I am attempting to use the Covariance_filter as an EKF for a non-linear > >> model. However, I do not understand which type of model class to use, > >> and how to specify the data for the models, even after looking at the > >> Bayesian Filtering overview. I'm pretty sure I need to use a > >> linrz_predict_model (or something like that) but beyond that... > > > > 'Linrz_predict_model' is definately what you want. > > > >> The main problem is that the elements of the f function I want to use > >> for the model are exponential. It's non-linear, with noise, but no > >> control (it's essentially 'the object I'm trying to predict is walking > >> around randomly, but within the laws of physics') How do you specify > >> that? > > > > No-control is fine. Control inputs just make the implementation more > > complex! I don't understand how you model can be 'exponential' when the > > physics are of something moving around at random. Or do you mean that you > > have exponentially correlated noise in you model? > > Actually, after sketching the algorithms out by hand, I don't understand > it either. ;) I do want a model that would be sufficient to track > something that might move at random, but the formula I had down clearly > wouldn't give it. > > >> I've been looking at the Welch and Bishop introduction and trying > >> to compare back to Bayes++, but with no avail. I'm fairly sure I could > >> use the libraries if my model was linear, but I don't quite see how to > >> put the non-linearity in there. > > > > I not sure of where you are stubling. Would it be possible to post the > > equations that model your system? > > As I mentioned above, I was using the wrong formulas. At the time I was > reading a report about EKF that purported to be using unconstrained > Brownian Motion for modeling and trying to reproduce their results, but > the formulas they gave don't produce anything approaching that, at > least, not how I read them. (One example: x_k = exp(-1/4(x_(k-1) + 1.5 > (deltax_(k-1)) from > http://page.mi.fu-berlin.de/~zaldivar/files/tr-b-05-12.pdf ) The paper looks to be totaly bogus to me! The first 13 pages are just a standard derivation of the Kalman filter then can be found in many books. The dynamic system model at the end of page 16 which you quote from is just nonsense. I'm not sure where they go it from. I think Welch and Bishop should have the equations you need. Otherwise take a look in: Estimation with Applications to Tracking and Navigation: Theory Algorithms and Software Yaakov Bar-Shalom, X. Rong Li, Thiagalingam Kirubarajan 2001 John Wiley & Sons, Inc. ISBNs: 0-471-41655-X (Hardback) 0-471-22127-9 (Electronic) Start with a "Continuous White Noise Acceleration Model". My own PV example in Bayes++ is a extension of this. It implements the IOU (see reference in code) in 1D. This is a little better as it bounds the growth of velocity uncertainty. Sorry I can't wrie much more at the moment. I will be checking my emails over the Christmas holidays and will attempt to help out if you have more questions. All the best, Michaelesclasses-general -- ___________________________________ Michael Stevens Systems Engineering 34128 Kassel, Germany Phone/Fax: +49 561 5218038 Navigation Systems, Estimation and Bayesian Filtering http://bayesclasses.sf.net ___________________________________ |