Library for decision threshold and boundary methods
Project description
🚀 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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file decision_methods-0.1.0.tar.gz.
File metadata
- Download URL: decision_methods-0.1.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd13a842ff3040e2f726fea6ed21c486e330cadf5fe0fe56eabb60fe8ef05a6a
|
|
| MD5 |
0a13ff193c41504b70eb4799f621bc72
|
|
| BLAKE2b-256 |
7f9c4d63f72678197ca08ff3ac25208038bf99c43049bd26cfc302cbc9e2e916
|
File details
Details for the file decision_methods-0.1.0-py3-none-any.whl.
File metadata
- Download URL: decision_methods-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75d6be81bcc2ab4b1ead4d8cf606e343c4e9edff9509c461816728b93cadd35a
|
|
| MD5 |
3342e8cbc49180eacf82d3b575ab57eb
|
|
| BLAKE2b-256 |
41f44030eeef2223f27d223d19365747242e4fb31b8b439f06c7e4a386efe227
|