Skip to content

Make MCMCMultiProposal defaults constructible #533

Description

@BJMCox

MCMCMultiProposal only accepts proposal vectors, but its default proposal value is a tuple.

using BAT

MCMCMultiProposal((MetropolisHastings(),), [1])

On d33ddf2b:

ERROR: MethodError: no method matching MCMCMultiProposal(
    ::Tuple{RandomWalk{Float64, Tuple{Float64, Float64}, TDist{Float64}}},
    ::Vector{Int64},
)

Closest candidates are:
  MCMCMultiProposal(!Matched::P, ::R) where
    {P<:(Vector{<:BAT.MCMCProposal}), ...}

The equivalent vector input constructs successfully. The type parameter requires P<:Vector, while the zero-argument default is (RandomWalk(), HamiltonianMC()). That default also fails earlier when the optional AdvancedHMC backend is not loaded.

Please choose one public input representation, normalize accepted inputs, and make the zero-argument default usable without an unloaded optional backend. Validate non-empty proposals and picking-rule lengths. Add default, tuple/vector, and Categorical constructor tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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