Bayesian “Shoot / Hold” Decision

A toy model: Bayes posterior + expected-cost decision threshold + Monte Carlo outcomes.

Runs 100% in-browser

Inputs



Decision rule: engage if P(Threat|E) × C_hit > C_shot × scarcity

Bayes Update

Posterior P(Threat | Evidence)
Threshold (Cshot×scarcity / Chit)
Decision
Bayes:
P(T|E) = (P(E|T)P(T)) / (P(E|T)P(T) + P(E|D)P(D))
Numerator:
Denominator:

As scarcity rises, effective shot cost rises, so the model demands higher confidence before shooting.

Monte Carlo Outcomes

Shots fired
Wasted shots on decoys
Threats engaged (hits prevented)
Threats NOT engaged (hits)
Magazine depletion

Monte Carlo generates a stream of “tracks.” Each track is threat or decoy (by the prior), then produces noisy evidence consistent with the sensor settings. The model applies the Bayes + threshold rule to decide.