{"id":33512354,"url":"https://github.com/gipert/bayesian-blocks","last_synced_at":"2025-11-26T05:03:46.927Z","repository":{"id":42466987,"uuid":"166714212","full_name":"gipert/bayesian-blocks","owner":"gipert","description":"Julia and C++ Implementations of the bayesian blocks algorithm https://arxiv.org/abs/1207.5578","archived":false,"fork":false,"pushed_at":"2023-08-20T15:42:08.000Z","size":2590,"stargazers_count":1,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-08-20T16:58:04.573Z","etag":null,"topics":["bayesian-statistics","binning","cpp","julia"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gipert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-20T22:02:02.000Z","updated_at":"2023-08-20T16:58:04.574Z","dependencies_parsed_at":"2022-09-13T15:03:10.272Z","dependency_job_id":null,"html_url":"https://github.com/gipert/bayesian-blocks","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/gipert/bayesian-blocks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gipert%2Fbayesian-blocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gipert%2Fbayesian-blocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gipert%2Fbayesian-blocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gipert%2Fbayesian-blocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gipert","download_url":"https://codeload.github.com/gipert/bayesian-blocks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gipert%2Fbayesian-blocks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286079811,"owners_count":27282121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-26T02:00:06.075Z","response_time":193,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian-statistics","binning","cpp","julia"],"created_at":"2025-11-26T05:03:46.391Z","updated_at":"2025-11-26T05:03:46.915Z","avatar_url":"https://github.com/gipert.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bayesian Blocks\n\nHeader-only C++ implementation of the Bayesian Blocks argorithm. Plug and play!\n\n```cpp\n#include \"baeysian_blocks.hpp\"\n#include \"baeysian_blocks_root.hpp\"  // if you want to rebin ROOT CERN histograms\n\nint main() {\n\n    // \"data\" is a a std::vector containing the observed values\n    // [optional] \"weights\" can be used to specify the weight (how many times an observation occurs)\n    auto change_points = BayesianBlocks::blocks(data, /* optional */ weights);\n    // \"change_points\" is a std::vector\n \n    // \"hist\" is a ROOT TH1*\n    auto h_rebin = dynamic_cast\u003cTH1*\u003e(BayesianBlocks::rebin(hist));\n    // \"h_rebin\" is the rebinned histogram\n    \n    return 0;\n}\n```\nCheck out the `BayesianBlocks::blocks` and `BayesianBlocks::rebin` signatures for a more advanced usage. Have a look at [`test/run_test.cc`](https://github.com/gipert/bayesian-blocks/blob/master/test/run_test.cc) too.\n\nBayesian blocks algorithm reference: *Scargle, J et al. (2012) [https://doi.org/10.1088/0004-637X/764/2/167]*\n\n## The `bblocks` utility\n\nThe `bblocks` program rebins all the 1-dim histograms contained in a ROOT file.\n\nInstall:\n```console\n$ cd cpp\n$ PREFIX=\u003cinstall-prefix\u003e make install\n```\n\nRun:\n```console\n$ bblocks --help\nUSAGE: bblocks [-v|--verbose] [-h|--help] [--p0 \u003cval\u003e (default 0.01)] file1 file2 ...\n```\n\n### Related\nJulia language enthusiast? Checl out my Julia package: https://github.com/gipert/BayesianBlocks.jl\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgipert%2Fbayesian-blocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgipert%2Fbayesian-blocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgipert%2Fbayesian-blocks/lists"}