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

Consider transfering the ESSModel to AbstractMCMC #112

Open
yebai opened this issue Dec 29, 2022 · 2 comments
Open

Consider transfering the ESSModel to AbstractMCMC #112

yebai opened this issue Dec 29, 2022 · 2 comments

Comments

@yebai
Copy link
Member

yebai commented Dec 29, 2022

We currently have a type ESSModel that implements a factorised version of logdensityproblem.

Now that we have the following new type, does it make sense to generalise and transfer the ESSModel type into this package?

- `logdensity`: The object that implements the LogDensityProblems.jl interface.
"""
struct LogDensityModel{L} <: AbstractModel
logdensity::L
function LogDensityModel{L}(logdensity::L) where {L}
if LogDensityProblems.capabilities(logdensity) === nothing
throw(
ArgumentError(
"The log density function does not support the LogDensityProblems.jl interface",
),
)
end
return new{L}(logdensity)
end
end

In addition, this factorisation is also helpful for other samplers like nested sampling (see NestedModel) and tempering methods (e.g. when we only temper the likelihood term).

cc @torfjelde @devmotion @mileslucas

@devmotion
Copy link
Member

Maybe it would be better to not have a dedicated model but a special log density function type with the desired factorization that can be used in LogDensityModel. Then it should be possible to use the same model with e.g. EllipticalSliceSampling and AdvancedHMC.

@torfjelde
Copy link
Member

I guess this is somewhat related to parts of the discussion in #85.

Maybe it would be better to not have a dedicated model but a special log density function type with the desired factorization that can be used in LogDensityModel.

This seems like a sensible approach 👍

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

3 participants