Skip to main content

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 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

decision_methods-0.1.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

decision_methods-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

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

Hashes for decision_methods-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd13a842ff3040e2f726fea6ed21c486e330cadf5fe0fe56eabb60fe8ef05a6a
MD5 0a13ff193c41504b70eb4799f621bc72
BLAKE2b-256 7f9c4d63f72678197ca08ff3ac25208038bf99c43049bd26cfc302cbc9e2e916

See more details on using hashes here.

File details

Details for the file decision_methods-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for decision_methods-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75d6be81bcc2ab4b1ead4d8cf606e343c4e9edff9509c461816728b93cadd35a
MD5 3342e8cbc49180eacf82d3b575ab57eb
BLAKE2b-256 41f44030eeef2223f27d223d19365747242e4fb31b8b439f06c7e4a386efe227

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page