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

log determinant of HMatrix #72

Open
ngiann opened this issue Jul 18, 2024 · 2 comments
Open

log determinant of HMatrix #72

ngiann opened this issue Jul 18, 2024 · 2 comments

Comments

@ngiann
Copy link
Contributor

ngiann commented Jul 18, 2024

A question please: how do I go about calculating the log-determinant of an HMatrix? Thanks.

@maltezfaria
Copy link
Member

It seems you can use the Cholesky decomposition:

$$\log(det(H)) = \log(det(L L^\top)) = \log(det(L)^2) = 2 \log(det(L))$$

Do you have a MWE example? You can call cholesky to factor an HMatrix, but you may need to tweak a bit with the internals to extract the diagonal of L.

Disclaimer: I know nothing about log determinants 😅

@maltezfaria
Copy link
Member

@ngiann Did you manage to compute the logdet of an HMatrix? If you are still interested I think adding the functionality should be straightforward (essentially we need to overload the diag function to compute the diagonal of hierarchical matrices, and wrap cholesky + diagonal with the simple computation above to compute the logdet).

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

No branches or pull requests

2 participants