Skip to content
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

Implement evaluation of a Gaussian density in case of special factorization of the covariance matrix #61

Closed
xEnVrE opened this issue May 8, 2019 · 8 comments
Assignees
Milestone

Comments

@xEnVrE
Copy link
Collaborator

xEnVrE commented May 8, 2019

This issue is for the implementation of a utility function to evaluate a multivariate Gaussian density in those cases in which the covariance matrix can be written in the form S = UV + R with R an invertible block diagonal matrix.

This is useful when the covariance matrix of the measurement model is such that

  • the evaluation of its inverse and
  • the evaluation of its determinant,

that are required to evaluate the Gaussian density, are computationally demanding because rows(S) is a large number. However, if cols(U) << rows(U), then it possible to use the Sherman-Morrison formula and the fact that R is block diagonal to reduce the problem to the inversion (and the evaluation of the determinant) of a matrix of size cols(U) x cols(U)

Once this is implemented, we will be able to implement bfl::SUKFCorrection::getLikelihood.

@xEnVrE xEnVrE changed the title Implement evalution of a Gaussian density for high dimensional measurement models Implement evaluation of a Gaussian density for high dimensional measurement models May 8, 2019
@claudiofantacci
Copy link
Collaborator

Thanks for the digression! Looking forward to it 👍

@xEnVrE xEnVrE added this to the 0.9.0 milestone May 24, 2019
@xEnVrE xEnVrE changed the title Implement evaluation of a Gaussian density for high dimensional measurement models Implement evaluation of a Gaussian density in case of special factorization of the covariance matrix May 24, 2019
@claudiofantacci
Copy link
Collaborator

Closed after #74.

@traversaro
Copy link
Member

traversaro commented May 27, 2019

@claudiofantacci @xEnVrE I am relative sure it does not apply to your case, but it may be interesting for you to know that in some context (where you have a lot of low-rank updates) the computation of the inverse matrix via repeated uses of the Sherman–Morrison–Woodbury identity is numerically noisy/unstable ( https://epubs.siam.org/doi/abs/10.1137/0907034?journalCode=sijcd4 ). For Symmetric Positive Definite matrices it is sometimes preferred to use the Cholesky Update, see for example https://www.semanticscholar.org/paper/Low-Rank-Updates-for-the-Cholesky-Decomposition-Seeger/8e22b71338d20c884bbb904155f12227781eb750 .

@claudiofantacci
Copy link
Collaborator

@traversaro thanks for the comment. I think we may want to consider it anyway 👍

@xEnVrE
Copy link
Collaborator Author

xEnVrE commented May 27, 2019

Thank you @traversaro for your point. I wasn't aware of this. If I am not wrong, Cholesky Update is also used in the square root form of the Unscented Kalman Filter exactly for this reason.

In the end, the paper from which we are taking this kind of usage of the SMW identity, rewrites the covariance matrix using a sort of Cholesky factorization but the inner structure of the factors is exactly known. Don't know if, by using Cholesky updates, it is possible to obtain the same speedup as we are getting with SMW. I'll read the references you pointed out.

@traversaro
Copy link
Member

If you are interested in this, we can also check out Section 3.3 of http://pasa.lira.dist.unige.it/pasapdf/1228_Gijsberts+Metta2012.pdf (that is actually the reason I am aware of this stuff).

@traversaro
Copy link
Member

traversaro commented May 27, 2019

@claudiofantacci
Copy link
Collaborator

Let's move the discussion in #76!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants