Skip to main content

🚀 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 vector
  • t_m (float) — Measurement time
  • t_f (float) — Background time
  • f (callable) — Multivariable function
  • pderivative (callable) — Partial derivative function
  • bisection (callable) — Root-finding method
  • k (float, optional) — Coverage factor (default: 1.65)
  • LID_a (float) — Lower bound for LID search
  • LID_b (float) — Upper bound for LID search
  • cpm_min(float) — Lower bound of the count rate (counts per unit time, e.g., minutes or seconds; CPM) used in the LID search
  • cpm_max(float) — Upper bound of the count rate (counts per unit time, e.g., minutes or seconds; CPM) used in the LID search
  • cpm_index(integer) — Index of the parameter corresponding to the count rate (CPM) used in the LID search
  • sample_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) pairs
  • frac_fondo (float, optional) — Relative uncertainty for background when t_f <= 0

Returns

  • value (float) — Evaluated value of the model function
  • u_value (float) — Combined uncertainty
  • UD (float) — Decision threshold
  • LID (float) — Decision limit

Returns

  • value (float) — Evaluated value of the model function
  • u_value (float) — Combined uncertainty
  • UD (float) — Decision threshold
  • LID (float) — Decision limit

📊 Visualization

🔹 plot_lid_function

Generates plots to analyze LID behavior.

Parameters

  • LID_a (float) — Lower bound
  • LID_b (float) — Upper bound
  • p (array-like) — Parameters
  • f (callable) — Function
  • UD (float) — Decision threshold
  • t_m (float) — Measurement time
  • t_f (float) — Background time
  • pderivative (callable) — Partial derivative function
  • bisection (callable) — Root-finding method
  • cpm_min(float) — Lower bound of the count rate (counts per unit time, e.g., minutes or seconds; CPM) used in the LID search
  • cpm_max(float) — Upper bound of the count rate (counts per unit time, e.g., minutes or seconds; CPM) used in the LID search
  • n(integer) — Number of samples or observations used in the LID search
  • cpm_index(integer) — Index of the parameter corresponding to the count rate (CPM) used in the LID search
  • k (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 counts
  • CPM_f (float) — Background counts
  • Eps (float) — Detection efficiency
  • V_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 counts
  • CPM_b_f (float) — Background beta counts
  • CPM_a_m (float) — Measured alpha counts
  • CPM_a_f (float) — Background alpha counts
  • Spill (float) — Spillover correction factor
  • EFSr (float) — Detection efficiency factor
  • Fa (float) — Correction factor
  • V_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)

Source distribution for decision-methods 0.1.0
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)

Table of built distributions (wheels) for decision-methods 0.1.0
File Interpreter ABI Platform Actions
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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page