Two functions that form the core of quantitative intelligence analysis: cumulative risk estimation and Bayesian belief updating with decision analysis.
Functions
ProbabilityOfHypothesisGivenData
Updates the probability of competing hypotheses given observed evidence using Bayes' Theorem. Also computes the Expected Value of Information (EVOI) — how much a piece of evidence is worth before you collect it.
from analysistoolbox.probability import ProbabilityOfHypothesisGivenData
results = ProbabilityOfHypothesisGivenData(
list_of_hypotheses=["Threat actor A", "Threat actor B", "Unknown"],
list_of_prior_probabilities=[0.5, 0.3, 0.2],
list_of_likelihoods=[0.8, 0.4, 0.1], # P(evidence | hypothesis)
observed_evidence="Malware signature X detected"
)
ProbabilityOfAtLeastOne
Calculates the probability that an event occurs at least once across multiple independent trials — essential for cumulative risk analysis.
from analysistoolbox.probability import ProbabilityOfAtLeastOne
# 30% annual probability over 5 years
p = ProbabilityOfAtLeastOne(
probability_per_trial=0.30,
number_of_trials=5
)
# Returns ~0.83 — 83% chance of at least one occurrence in 5 years
Use cases
- Intelligence analysis: updating assessments as evidence accumulates
- Clinical diagnostics: posterior probability of disease given test results
- Risk analysis: cumulative probability of an event over a time horizon
- Decision analysis: EVOI for collection prioritization