-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from francescoalemanno/type
enhance usability - add BHist - add to_pdf, Significance - revamp plots - update readme - remove useless deps
- Loading branch information
Showing
9 changed files
with
160 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,34 @@ | ||
# BayesHistogram.jl | ||
optimal histogram binning based on piecewise constant model | ||
Optimal histogram binning based on piecewise constant model. | ||
|
||
![plot.png](plot.png "") | ||
Paper: _Studies in Astronomical Time Series Analysis. VI. Bayesian Block Representations_ [https://arxiv.org/abs/1207.5578] | ||
|
||
for more worked examples read `make_plot.jl`. | ||
for a showcase look below. | ||
|
||
## Installation | ||
```julia | ||
using Pkg | ||
Pkg.add("BayesHistogram") | ||
``` | ||
|
||
## Simple usage | ||
```julia | ||
using Plots, BayesHistogram | ||
X = exp.(randn(5000)./3) | ||
bl = bayesian_blocks(X) | ||
# plot using "to_pdf" | ||
support, density = to_pdf(bl) | ||
plot(support, density) | ||
# or using "edges" parameter and an histogramming procedure | ||
histogram(X, bins=bl.edges, normalize = :pdf) | ||
``` | ||
|
||
## Showcase | ||
### it handles weighted data and errors correctly | ||
![plot2.png](plot2.png "") | ||
### bins are determined automatically & optimally | ||
![plot3.png](plot3.png "") | ||
### it routinely outperforms common binning rules | ||
![plot.png](plot.png "") | ||
|
||
for worked examples read `make_plot.jl`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters