Skip to content

FixedNBins fails in marginal-mode estimation #551

Description

@BJMCox

Problem

FixedNBins is available as a binning policy, and BinnedModeEstimator accepts it. Marginal-mode estimation then raises a MethodError. Automatic binning works on the same samples.

Impact

Users cannot select a fixed number of bins for marginal-mode estimation.

Reproduction

using BAT

ctx = BATContext()
samples = DensitySampleVector(
    [[1.0], [2.0], [3.0], [4.0], [5.0]],
    zeros(5),
)

bat_marginalmode(
    samples,
    BinnedModeEstimator(binning = FixedNBins(nbins = 2)),
    ctx,
)

Output

MethodError: no method matching _get_bining_impl(::FixedNBins, ::Int64, ::Float64, ::Vector{Float64})

Expected result

Positive fixed bin counts should work through marginal-mode estimation and select the requested number of bins.

Related to #166.

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions