🚀 decision_methods
A scientific Python library for computing decision thresholds and limits using numerical methods independent of the analytical expression.
Includes advanced implementations such as:
- UD — Decision Threshold
- LID — Decision Limit
✨ Key Features
- Numerical methods applicable to any analytical model
- Full uncertainty propagation
- Robust root-finding algorithms
- Scientific computation ready for real-world data
- Visualization tools for LID analysis
⚙️ Core Function
🔹 compute_F_ud_lid
Computes:
- Model value
- Associated uncertainty
- Decision Threshold (UD)
- Decision Limit (LID)
Parameters
p(array-like) — Model parameter vectort_m(float) — Measurement timet_f(float) — Background timef(callable) — Multivariable functionpderivative(callable) — Partial derivative functionbisection(callable) — Root-finding methodk(float, optional) — Coverage factor (default: 1.65)LID_a(float) — Lower bound for LID searchLID_b(float) — Upper bound for LID searchcpm_min(float) — Lower bound of the count rate (counts per unit time, e.g., minutes or seconds; CPM) used in the LID searchcpm_max(float) — Upper bound of the count rate (counts per unit time, e.g., minutes or seconds; CPM) used in the LID searchcpm_index(integer) — Index of the parameter corresponding to the count rate (CPM) used in the LID searchsample_indices(tuple of int, optional) — Indices of parameters corresponding to sample measurements modeled as Poisson-distributed variables, with expected counts defined as the parameter value scaled by the measurement time t_m (default: (0,))background_indices(tuple of int, optional) — Indices of parameters corresponding to sample measurements modeled as Poisson-distributed variables, with expected counts defined as the parameter value scaled by the measurement time t_f (default: (1,))rel_map(tuple of (int, float), optional) — Relative uncertainty definitions as (index, relative_error) pairsfrac_fondo(float, optional) — Relative uncertainty for background whent_f <= 0
Returns
value(float) — Evaluated value of the model functionu_value(float) — Combined uncertaintyUD(float) — Decision thresholdLID(float) — Decision limit
Returns
value(float) — Evaluated value of the model functionu_value(float) — Combined uncertaintyUD(float) — Decision thresholdLID(float) — Decision limit
📊 Visualization
🔹 plot_lid_function
Generates plots to analyze LID behavior.
Parameters
LID_a(float) — Lower boundLID_b(float) — Upper boundp(array-like) — Parametersf(callable) — FunctionUD(float) — Decision thresholdt_m(float) — Measurement timet_f(float) — Background timepderivative(callable) — Partial derivative functionbisection(callable) — Root-finding methodcpm_min(float) — Lower bound of the count rate (counts per unit time, e.g., minutes or seconds; CPM) used in the LID searchcpm_max(float) — Upper bound of the count rate (counts per unit time, e.g., minutes or seconds; CPM) used in the LID searchn(integer) — Number of samples or observations used in the LID searchcpm_index(integer) — Index of the parameter corresponding to the count rate (CPM) used in the LID searchk(float, optional) — Coverage factor (default: 1.65)rel_map(tuple of (int, float), optional) — Relative uncertainty definitions as (index, relative_error) pairs
🧪 Activity Functions
🔹 AT — Total Alpha
Computes total alpha activity.
$AT(Bq\cdot m^{3})= \frac{CPM_M-CPM_F}{60 \cdot ɛ \cdot V_{Alicuot}}$
Parameters
CPM_m(float) — Sample countsCPM_f(float) — Background countsEps(float) — Detection efficiencyV_ali(float) — Aliquot volume
Returns
- (float) — Activity
🔹 BT — Total Beta
Computes total beta activity.
$BT(Bq\cdot m^{3})= \frac{CPM_{\beta-M}-CPM_{\beta-F} - γ \cdot(CPM_{α-M}-CPM_{α-F})}{60 \cdot Ef_{Sr} \cdot V_{Alicuot}⋅Fa}$
Parameters
CPM_b_m(float) — Measured beta countsCPM_b_f(float) — Background beta countsCPM_a_m(float) — Measured alpha countsCPM_a_f(float) — Background alpha countsSpill(float) — Spillover correction factorEFSr(float) — Detection efficiency factorFa(float) — Correction factorV_ali(float) — Aliquot volume
Returns
- (float) — Total beta activity
📦 Installation
pip install decision_methods
Metadata
Release files for decision-methods 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| decision_methods-0.1.0.tar.gz | 7.8 kB | Without provenance | Details for decision_methods-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| decision_methods-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for decision_methods-0.1.0-py3-none-any.whl |
Total release size: 15.1 kB
Release files / decision_methods-0.1.0.tar.gz
| Download URL | decision_methods-0.1.0.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd13a842ff3040e2f726fea6ed21c486e330cadf5fe0fe56eabb60fe8ef05a6a
|
|
BLAKE2b-256 checksum How to use checksums |
7f9c4d63f72678197ca08ff3ac25208038bf99c43049bd26cfc302cbc9e2e916
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / decision_methods-0.1.0-py3-none-any.whl
| Download URL | decision_methods-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75d6be81bcc2ab4b1ead4d8cf606e343c4e9edff9509c461816728b93cadd35a
|
|
BLAKE2b-256 checksum How to use checksums |
41f44030eeef2223f27d223d19365747242e4fb31b8b439f06c7e4a386efe227
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Security for decision-methods 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.