ir-lab / intprim

Interaction Primitives library
MIT License
62 stars 18 forks source link

Is epsilon_y and correspondingly Sigma_y used? #2

Closed souljaboy764 closed 4 years ago

souljaboy764 commented 4 years ago

I was going through the code and I saw that no where is Sigma_y or epsilon_y used. In the paper it's just mentioned in Eq. 2 and while defining x_d but after that it's not mentioned anywhere else. Is it the observation_noise parameter that is used during the inference? If not, can you please help me understand if and how it is modelled or is there a trick that allows to do away with it altogether?

joe-campbell commented 4 years ago

Epsilon_y corresponds to a simple linear regression model where the functions are non-linear basis functions (Phi). Since this is inherently an approximation, we capture the error with the term Epsilon_y (mathematically, this means we do not need to use \approx and can instead use \equals but that is another matter).

In the case of Sigma_y in Eq. 2, we are simply saying that if we have some vector of weight coefficients w, then the probability density of observing some sensor measurement at time t is given by Eq. 2 where Sigma_y represents the variance in the sensor measurements. Practically speaking, this is not used directly in computations because we never need to directly compute it. However, we do determine how much to trust the observations given our own current state estimate through the use of the Kalman gain (Eq. 9), which is essentially a least squares calculation in its own right. It might be helpful to browse through some works which dedicate more time to Kalman filters. For books, you can't go wrong with Probabilistic Robots by Thrun, et al and for a more intuitive dive I highly recommend this online series of Python notebooks: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python.

I have also published some more recent work which might help clarify some things, I recommend looking at: Probabilistic Multimodal Modeling for Human-Robot Interaction Tasks https://arxiv.org/abs/1908.04955

Learning Interactive Behaviors for Musculoskeletal Robots Using Bayesian Interaction Primitives https://arxiv.org/abs/1908.05552

souljaboy764 commented 4 years ago

Oh ok. So essentially, epsilon_y is the error in the linear regression estimate of (Phi*w - Y) and Sigma_y is basically the sensor measurement variance (Q) that is used in the Kalman Gain estimation for the EKF measurement update?

Also, thanks for the references, will definitely check them out.

joe-campbell commented 4 years ago

Yep, that's right!

No problem. If you have any more questions feel free to ask.

Just as a heads up in the next couple of days I will be uploading v2 of the library which reworks pretty much everything and includes the code for running the algorithms outlined in the references I gave.

joe-campbell commented 4 years ago

Just to follow up, we have now released v2 of IntPrim. If you have any more questions or run into any issues, please open another issue or contact me directly.

Thanks!