Skip to content

Consider transfering the ESSModel to AbstractMCMC #112

@yebai

Description

@yebai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions