autohist.jl

Fast and automatic histogram construction in Julia

https://github.com/oskarhs/autohist.jl

Science Score: 98.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 13 DOI reference(s) in README and JOSS metadata
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

histogram julia julia-package statistics
Last synced: 6 months ago · JSON representation ·

Repository

Fast and automatic histogram construction in Julia

Basic Info
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • Open Issues: 2
  • Releases: 13
Topics
histogram julia julia-package statistics
Created almost 2 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

AutoHist.jl

Build Status codecov Doc Doc

A pure Julia implementation of automatic regular and irregular histogram methods based on maximizing a goodness-of-fit criterion.

Introduction

Most default histogram plotting software only support a few regular automatic histogram procedures and use very simple plug-in rules by default to compute the the number of bins, frequently leading to poor density estimates for non-normal data [cf. Birgé and Rozenholc (2006), Simensen et al. (2025)]. The purpose of this software package is to offer the user a fast and simple-to-use implementation of more sophisticated regular and irregular histogram procedures. Our package supports a variety of methods including those based on asymptotic risk minimization, leave-one-out cross-validiation, penalized maximum likelihood and fully Bayesian approaches.

Installation

Installing the package is most easily done via Julia's builtin package manager Pkg. This package is part of the Julia general registry, so the installation can be done via the two following lines of code: julia using Pkg Pkg.add("AutoHist")

Quick start

To get started, we illustrate the basic use of the package by fitting histograms to a normal random sample with an automatic selection of the histogram partition.

julia using AutoHist x = randn(10^6) h1 = fit(AutomaticHistogram, x)

Several rules are available to select the histogram partition, and can be controlled through the use of the rule positional argument. For instance, a regular histogram based on maximizing the AIC can be fit as follows: julia h2 = fit(AutomaticHistogram, x, AIC()) Alternatively, we can use the autohist method, which serves as an alias for fit(AutomaticHistogram, ...) julia h2 = autohist(x, AIC())

A detailed exposition of the keyword arguments passed to fit can be found by typing ?fit in the repl or in the API documentation. A detailed description of all methods currently implemented in AutoHist.jl can be found in the methods documentation.

The fitted histograms can be displayed through the Plots.jl or Makie.jl packages as follows:

julia import Plots, CairoMakie, Makie Plots.plot(h1) Makie.plot(h1)

Supported criteria

The argument rule determines the method used to construct the histogram for both of the histogram functions. The rule used to construct the histogram can be changed by setting rule equal to a symbol indicating the method to be used, e.g. BIC() which yields an automatic regular histogram based on the BIC criterion.

The default method is the Bayesian approach of Simensen et al. (2025), corresponding to keyword rule=RIH(). A detailed description of the supported methods can be found in the methods documentation.

Contributing

If you encounter a bug when using this software or have a feature request, then feel free to open a github issue.

Coding contributions are also very much welcome, especially if you are looking to add a new automatic histogram rule or a new algorithm. To make sure that your proposed new feature is a good fit for the AutoHist package, please open a new issue to discuss how your contribution could elevate AutoHist.jl.

References

Simensen, O. H., Christensen, D. & Hjort, N. L. (2025). Random Irregular Histograms. arXiv preprint. doi: 10.48550/ARXIV.2505.22034

Rozenholc, Y., Mildenberger, T., & Gather, U. (2010). Combining regular and irregular histograms by penalized likelihood. Computational Statistics & Data Analysis, 54, 3313–3323. doi: 10.1016/j.csda.2010.04.021

Kanazawa, Y. (1988). An optimal variable cell histogram. Communications in Statistics-Theory and Methods, 17, 1401–1422. doi: 10.1080/03610928808829688

Birgé, L., & Rozenholc, Y. (2006). How many bins should be put in a regular histogram. ESAIM: Probability and Statistics, 10, 24–45. doi: 10.1051/ps:2006001

Owner

  • Name: Oskar Høgberg Simensen
  • Login: oskarhs
  • Kind: user

JOSS Publication

AutoHist.jl: A Julia package for fast and automatic histogram construction
Published
September 23, 2025
Volume 10, Issue 113, Page 8850
Authors
Oskar Høgberg Simensen ORCID
Scientific Computing Center, Karlsruhe Institute of Technology
Editor
Mehmet Hakan Satman ORCID
Tags
statistics histograms density estimation

Citation (CITATION.cff)

cff-version: 1.2.0
message: "Cite this paper whenever AutoHist.jl played an important role in your research"
authors:
- family-names: "Simensen"
  given-names: "Oskar Høgberg"
  orcid: "https://orcid.org/0009-0009-5056-7324"
title: "AutoHist.jl: A pure Julia library for fast automatic histogram construction"
version: "v0.2.2"
license: "MIT"
date-released: 2025-06-01
url: "https://github.com/oskarhs/AutoHist.jl.git"

GitHub Events

Total
  • Create event: 22
  • Commit comment event: 29
  • Issues event: 4
  • Release event: 11
  • Watch event: 4
  • Delete event: 15
  • Issue comment event: 10
  • Push event: 201
  • Pull request event: 9
Last Year
  • Create event: 22
  • Commit comment event: 29
  • Issues event: 4
  • Release event: 11
  • Watch event: 4
  • Delete event: 15
  • Issue comment event: 10
  • Push event: 201
  • Pull request event: 9

Packages

  • Total packages: 1
  • Total downloads:
    • julia 1 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 12
juliahub.com: AutoHist

Fast and automatic histogram construction in Julia

  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1 Total
Rankings
Dependent repos count: 8.4%
Average: 22.3%
Dependent packages count: 36.1%
Last synced: 6 months ago

Dependencies

.github/workflows/CI.yml actions
  • actions/checkout v4 composite
  • julia-actions/cache v1 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/CompatHelper.yml actions
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite