Skip to content

Implement Bayesian Blocks histogram algorithm #34

@noahgift

Description

@noahgift

Implement the Bayesian Blocks optimal histogram binning algorithm to eliminate the only TODO in the codebase.

Background:
Currently, BinMethod::Bayesian falls back to Freedman-Diaconis rule. The proper implementation should use the Bayesian Blocks algorithm (Scargle et al., 2013) which uses dynamic programming to find optimal change points.

Algorithm:

  • Input: Data points, prior on number of blocks
  • Output: Optimal histogram bin edges
  • Method: O(n²) dynamic programming
  • Finds change points that maximize posterior probability

Acceptance Criteria:

  • Implement Bayesian Blocks algorithm in stats module
  • Add comprehensive tests (EXTREME TDD)
  • Add example demonstrating the algorithm
  • Update documentation
  • Remove TODO comment from code

References:

  • Scargle, J. D., et al. (2013). "Studies in Astronomical Time Series Analysis. VI. Bayesian Block Representations." ApJ, 764, 167.

Labels: enhancement, stats

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions