diff --git a/Project.toml b/Project.toml index cc7d8b8d..7c40ca91 100644 --- a/Project.toml +++ b/Project.toml @@ -3,7 +3,7 @@ uuid = "80f14c24-f653-4e6a-9b94-39d6b0f70001" keywords = ["markov chain monte carlo", "probabilistic programming"] license = "MIT" desc = "A lightweight interface for common MCMC methods." -version = "5.8.2" +version = "5.9.0" [deps] BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66" diff --git a/src/AbstractMCMC.jl b/src/AbstractMCMC.jl index e103d5a5..185082a3 100644 --- a/src/AbstractMCMC.jl +++ b/src/AbstractMCMC.jl @@ -106,7 +106,14 @@ See also [`sample`](@ref). struct MCMCSerial <: AbstractMCMCEnsemble end """ - getparams([model::AbstractModel, ]state) + requires_unconstrained_space(sampler::AbstractSampler)::Bool + +Return `true` if the given sampler must run in unconstrained space. Defaults to true. +""" +requires_unconstrained_space(::AbstractSampler) = true + +""" + getparams([model::AbstractModel, ]state)::Vector{<:Real} Retrieve the values of parameters from the sampler's `state` as a `Vector{<:Real}`. """ @@ -116,6 +123,13 @@ function getparams(model::AbstractModel, state) return getparams(state) end +""" + getstats(state)::NamedTuple + +Retrieve sampler statistics from the sampler's `state` as a `NamedTuple`. +""" +function getstats end + """ setparams!!([model::AbstractModel, ]state, params)