A tool to perform toyMC-based inference constructions
Project description
alea
alea is a flexible statistical inference framework. The Python package is designed for constructing, handling, and fitting statistical models, computing confidence intervals and conducting sensitivity studies. It is primarily developed for the XENONnT dark matter experiment, but can be used for any statistical inference problem.
Alea aims to model the statistical behaviour of an experiment, which again depends on your knowledge of the underlying physics-- this can range from the very simple, such as measuring a gaussian-distributed random variable, to complex likelihoods where each model component is created by physics simulations (GEANT4), fast detector simulations (for example appletree for XENONnT) or a data-driven method.
If you use alea in your research, please consider citing the software published on zenodo.
Installation
You can install alea from PyPI using pip but beware that it is listed there as alea-inference! Thus, you need to run
pip install alea-inference
For the latest version, you can install directly from the GitHub repository by cloning the repository and running
cd alea
pip install .
You are now ready to use alea!
Getting started
The best way to get started is to check out the documentation and have a look at our tutorial notebooks. To explore the notebooks interactively, you can use Binder.
Acknowledgements
alea
is a public package inherited the spirits of previously private XENON likelihood definition and inference construction code binference
that based on the blueice repo https://github.com/JelleAalbers/blueice.
Binference was developed for XENON1T WIMP searches by Knut Dundas Morå, and for the first XENONnT results by Robert Hammann, Knut Dundas Morå and Tim Wolf.
0.2.6 / 2024-07-31
- Defunctionalize
apply_efficiency
, apply efficiency whenefficiency_name
is specified by @dachengx in https://github.com/XENONnT/alea/pull/183
Full Changelog: https://github.com/XENONnT/alea/compare/v0.2.5...v0.3.0
0.2.5 / 2024-07-30
- Consistent sorting for BlueiceExtendedModel by @hammannr in https://github.com/XENONnT/alea/pull/149
- Fixed data storing by @hammannr in https://github.com/XENONnT/alea/pull/152
- Add lxml_html_clean to fix readthedocs building error by @zihaoxu98 in https://github.com/XENONnT/alea/pull/157
- Fitting index variables by @zihaoxu98 in https://github.com/XENONnT/alea/pull/156
- Print Argument combinations to be submitted by @hammannr in https://github.com/XENONnT/alea/pull/151
- Minor changes to fitting index variables (PR #156) by @hammannr in https://github.com/XENONnT/alea/pull/159
- Set
i_batch
forSubmitterLocal
when submitting by @dachengx in https://github.com/XENONnT/alea/pull/164 - Debug for interpolator deduction of
NeymanConstructor
by @dachengx in https://github.com/XENONnT/alea/pull/165 - The first i batch should be 0 by @dachengx in https://github.com/XENONnT/alea/pull/166
- Try prefix every file path in likelihood configuration with template folder by @dachengx in https://github.com/XENONnT/alea/pull/169
- Forbid prexing every key when adapt_likelihood_config_for_blueice by @FaroutYLq in https://github.com/XENONnT/alea/pull/170
- Refactored Pegasus-based OSG submitter by @FaroutYLq in https://github.com/XENONnT/alea/pull/163
- Try fixing https://github.com/XENONnT/alea/issues/173 by @dachengx in https://github.com/XENONnT/alea/pull/176
- Allow assigning kwargs in debug mode by @dachengx in https://github.com/XENONnT/alea/pull/174
- Allow
confidence_level
in filename by @dachengx in https://github.com/XENONnT/alea/pull/179 - Add 68% coverage as one of the defaults of
confidence_levels
by @dachengx in https://github.com/XENONnT/alea/pull/180 - Document to increase CPUs by @FaroutYLq in https://github.com/XENONnT/alea/pull/178
New Contributors
- @FaroutYLq made their first contribution in https://github.com/XENONnT/alea/pull/170
Full Changelog: https://github.com/XENONnT/alea/compare/v0.2.4...v0.2.5
0.2.4 / 2024-03-18
- Point away from alea for physics models by @kdund in https://github.com/XENONnT/alea/pull/143
- Make "piecewise" the default pdf interpolation by @hammannr in https://github.com/XENONnT/alea/pull/142
- Enforce bins in config and template to match by @hammannr in https://github.com/XENONnT/alea/pull/144
- Make model histograms accessible by @hammannr in https://github.com/XENONnT/alea/pull/140
- Make local submitter verbose by @hammannr in https://github.com/XENONnT/alea/pull/146
- Estimator of signal multiplier based on perturbation theory by @zihaoxu98 in https://github.com/XENONnT/alea/pull/147
Full Changelog: https://github.com/XENONnT/alea/compare/v0.2.3...v0.2.4
0.2.3 / 2024-02-22
- Improve check of already made toydata and output by @dachengx in https://github.com/XENONnT/alea/pull/128
- Combine several jobs into one to save computation resources by @dachengx in https://github.com/XENONnT/alea/pull/131
- Check
locate
loaded package by @dachengx in https://github.com/XENONnT/alea/pull/134 - Update
hypotheses
andcommon_hypothesis
bypre_process_poi
by @dachengx in https://github.com/XENONnT/alea/pull/135 - Print total number of submitted jobs by @dachengx in https://github.com/XENONnT/alea/pull/137
Full Changelog: https://github.com/XENONnT/alea/compare/v0.2.2...v0.2.3
0.2.2 / 2024-01-13
- Save dtype of
valid_fit
as bool by @dachengx in https://github.com/XENONnT/alea/pull/123 - Optional setting of random seed for debugging by @dachengx in https://github.com/XENONnT/alea/pull/122
- Tiny minor change on docstring by @dachengx in https://github.com/XENONnT/alea/pull/126
- Change example filename extension by @kdund in https://github.com/XENONnT/alea/pull/93
- Add axis_names to example templates by @hammannr in https://github.com/XENONnT/alea/pull/127
- Evaluate
blueice_anchors
expression by @dachengx in https://github.com/XENONnT/alea/pull/124 - Update pypi to use trusted publisher by @dachengx in https://github.com/XENONnT/alea/pull/130
- Update versions of
blueice
andinference-interface
by @dachengx in https://github.com/XENONnT/alea/pull/132
Full Changelog: https://github.com/XENONnT/alea/compare/v0.2.1...v0.2.2
0.2.1 / 2023-12-08
- Add optional argument
degree_of_freedom
forasymptotic_critical_value
by @dachengx in https://github.com/XENONnT/alea/pull/86 - Update readthedocs configurations by @dachengx in https://github.com/XENONnT/alea/pull/88
- Update tutorials by @hammannr in https://github.com/XENONnT/alea/pull/89
- Add column to toyMC results with minuit convergence flag by @kdund in https://github.com/XENONnT/alea/pull/91
- Debug a typo at docstring of fittable parameter by @dachengx in https://github.com/XENONnT/alea/pull/95
- Improve documentation by @hammannr in https://github.com/XENONnT/alea/pull/101
- Update Neyman threshold when changing runner_args by @hammannr in https://github.com/XENONnT/alea/pull/100
- Allow submitter to skip the already succeeded files by @dachengx in https://github.com/XENONnT/alea/pull/94
- Print time usage of
Runner.run
by @dachengx in https://github.com/XENONnT/alea/pull/104 - Get expectation values per likelihood term by @hammannr in https://github.com/XENONnT/alea/pull/106
- Prevent arguments to submission variations being changed by deepcopy-ing them. by @dachengx in https://github.com/XENONnT/alea/pull/107
- Make error message more explicit that an excecutable is not found and… by @kdund in https://github.com/XENONnT/alea/pull/109
- Read poi and expectation directly from
output_filename
to accelerateNeymanConstructor
by @dachengx in https://github.com/XENONnT/alea/pull/108 - Direct call of used parameters of model by @dachengx in https://github.com/XENONnT/alea/pull/112
- Add function to get all sources names from all likelihoods by @dachengx in https://github.com/XENONnT/alea/pull/111
- Make sure values of parameters that need re-initialization are not changed by @hammannr in https://github.com/XENONnT/alea/pull/110
- Allow all computation names by @kdund in https://github.com/XENONnT/alea/pull/116
- Debug for the missing argument in
_read_poi
by @dachengx in https://github.com/XENONnT/alea/pull/118 - Remove unnecessary warning given new ptype constraints by @dachengx in https://github.com/XENONnT/alea/pull/119
Full Changelog: https://github.com/XENONnT/alea/compare/v0.2.0...v0.2.1
0.2.0 / 2023-09-01
- Proposal to use pre-commit for continuous integration by @dachengx in https://github.com/XENONnT/alea/pull/78
- Example notebooks by @hammannr in https://github.com/XENONnT/alea/pull/75
- Simplify TemplateSource, CombinedSource and SpectrumTemplateSource by @dachengx in https://github.com/XENONnT/alea/pull/69
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/XENONnT/alea/pull/80
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/XENONnT/alea/pull/82
- Add Submitter and NeymanConstructor by @dachengx in https://github.com/XENONnT/alea/pull/79
New Contributors
- @pre-commit-ci made their first contribution in https://github.com/XENONnT/alea/pull/80
Full Changelog: https://github.com/XENONnT/alea/compare/v0.1.0...v0.2.0
0.1.0 / 2023-08-11
- Unify and clean code style and docstring by @dachengx in https://github.com/XENONnT/alea/pull/68
- First runner manipulating statistical model by @dachengx in https://github.com/XENONnT/alea/pull/50
- Set best_fit_args to confidence_interval_args if None by @kdund in https://github.com/XENONnT/alea/pull/76
- Livetime scaling by @kdund in https://github.com/XENONnT/alea/pull/73
Full Changelog: https://github.com/XENONnT/alea/compare/v0.0.0...v0.1.0
0.0.0 / 2023-07-28
- readme update with pointer to previous work in lieu of commit history by @kdund in https://github.com/XENONnT/alea/pull/8
- Adds a statistical model base class (under construction by @kdund in https://github.com/XENONnT/alea/pull/7
- change folder/module name by @kdund in https://github.com/XENONnT/alea/pull/9
- Move submission_script.py also from binference to here by @dachengx in https://github.com/XENONnT/alea/pull/10
- Add simple gaussian model by @hammannr in https://github.com/XENONnT/alea/pull/12
- Parameter class by @hammannr in https://github.com/XENONnT/alea/pull/19
- Confidence intervals by @kdund in https://github.com/XENONnT/alea/pull/27
- Update README.md by @kdund in https://github.com/XENONnT/alea/pull/29
- Init code style checking, pytest, and coverage by @dachengx in https://github.com/XENONnT/alea/pull/31
- Add templates for wimp example by @hoetzsch in https://github.com/XENONnT/alea/pull/30
- Removes all hash for parameters not used for each source, and for all… by @kdund in https://github.com/XENONnT/alea/pull/37
- First implementation of an nT-like likelihood by @hammannr in https://github.com/XENONnT/alea/pull/32
- Check if some parameter is not set as guess when fitting by @kdund in https://github.com/XENONnT/alea/pull/44
- Fix likelihood_names check in statistical_model.store_data to handle unnamed likelihoods by @kdund in https://github.com/XENONnT/alea/pull/45
- Create pull_request_template.md by @dachengx in https://github.com/XENONnT/alea/pull/46
- Codes style cleaning by @dachengx in https://github.com/XENONnT/alea/pull/49
- First runner manipulating statistical model by @dachengx in https://github.com/XENONnT/alea/pull/47
- Run test on main not master by @dachengx in https://github.com/XENONnT/alea/pull/55
- Simplify file structure by @dachengx in https://github.com/XENONnT/alea/pull/51
- Move
blueice_extended_model
tomodels
by @dachengx in https://github.com/XENONnT/alea/pull/56 - Change data format to only use structured arrays by @kdund in https://github.com/XENONnT/alea/pull/42
- Another fitting test by @kdund in https://github.com/XENONnT/alea/pull/59
- Add first tests module and file indexing system by @dachengx in https://github.com/XENONnT/alea/pull/54
- Shape parameters by @hammannr in https://github.com/XENONnT/alea/pull/58
- Recover examples folder, update file indexing, add notebooks folder, remove legacies by @dachengx in https://github.com/XENONnT/alea/pull/61
- Remove pdf_cache folder before pytest by @dachengx in https://github.com/XENONnT/alea/pull/65
- Make 0.0.0, initialize documentation structure based on readthedocs, add badges to README by @dachengx in https://github.com/XENONnT/alea/pull/66
New Contributors
- @kdund made their first contribution in https://github.com/XENONnT/alea/pull/8
- @dachengx made their first contribution in https://github.com/XENONnT/alea/pull/10
- @hammannr made their first contribution in https://github.com/XENONnT/alea/pull/12
- @hoetzsch made their first contribution in https://github.com/XENONnT/alea/pull/30
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file alea-inference-0.2.6.tar.gz
.
File metadata
- Download URL: alea-inference-0.2.6.tar.gz
- Upload date:
- Size: 83.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5de40fd65a32e62676d72beab0acba9c1e9a232f2d963eb488f0b6c4cd8e5b7 |
|
MD5 | 773cea54602518fa12b49e2f16e948ba |
|
BLAKE2b-256 | 8aa37d9aee14b3000458ab3ad574bb7bc94b6fc45b14689772811f2ce180fad8 |
File details
Details for the file alea_inference-0.2.6-py3-none-any.whl
.
File metadata
- Download URL: alea_inference-0.2.6-py3-none-any.whl
- Upload date:
- Size: 111.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 523429548cb1eb3c5406ff5f9fedc9937103cd5913c859b4c079514a8675a9f4 |
|
MD5 | 0364dd3e26eee39d8608d9b48db4584a |
|
BLAKE2b-256 | 77a5a1d4dc6209398a7e6eecafce3927a26bb1e69b25eeea5c61286e95ab4a1b |