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

Add API for residuals and Jacobians for least-squares type log-densities #107

Open
jeffrey-hokanson-numerica opened this issue Aug 24, 2023 · 1 comment

Comments

@jeffrey-hokanson-numerica

Some recent MCMC samplers such as "Randomize-then-optimize" exploit least squares structure in the log-likelihood; i.e., the log-density has the form $f(x) = \sum_j f_j(x)^2$. Could we add this kind of derivative information into the API? As a proposal, I would suggest something like

residual(ℓ, x)
jacobian(ℓ, x)

which is similar to the NLSolversBase.jl API. Non-allocating versions would be helpful as well, e.g., writing into the last argument

residual!(ℓ, x, res)
jacobian!(ℓ, x, jac)
@tpapp
Copy link
Owner

tpapp commented Dec 22, 2023

Sorry for the late reply. I am not entirely sure that this package is the ideal home for an API like that, for the following reasons:

  1. it is pretty much orthogonal to our current one
  2. either we require that all implementations support it, or introduce further API to query support

I would recommend that a package using that algorithm just implements this API, and then if multiple methods end up using it it can be factored out to an interface package.

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