Calculator Inputs
Formula Used
The calculator uses Bayesian decision theory with three actions: accept positive, defer, and accept negative.
P(Positive|E) = [P(Positive) × P(E|Positive)] / [P(Positive) × P(E|Positive) + P(Negative) × P(E|Negative)]
R(Positive) = λPPp + λPN(1 − p)
R(Boundary) = λBPp + λBN(1 − p)
R(Negative) = λNPp + λNN(1 − p)
α = (λPN − λBN) / [(λPN − λBN) + (λBP − λPP)]
β = (λBN − λNN) / [(λBN − λNN) + (λNP − λBP)]
In the classic interpretation, accept positive when p ≥ α, accept negative when p ≤ β, and defer otherwise. The final recommendation is always based on the smallest expected loss.
How to Use This Calculator
- Enter a case label so your export files are easy to identify.
- Choose Direct Posterior Probability if you already know P(Positive|E).
- Choose Bayes Components if you want the calculator to derive the posterior from priors and likelihoods.
- Fill the six loss values for the three actions under the two true states.
- Click Calculate Decision to see the recommended action, threshold values, and expected-loss comparison.
- Review the Plotly chart to understand where each action becomes optimal.
- Use the CSV or PDF buttons to download a report of the current scenario.
Example Data Table
This sample table uses the default loss matrix: λPP=0, λPN=9, λBP=2, λBN=3, λNP=10, λNN=0.
| Scenario | Prior P(Positive) | P(E|Positive) | P(E|Negative) | Posterior P(Positive|E) | Decision |
|---|---|---|---|---|---|
| High evidence | 0.60 | 0.90 | 0.20 | 0.870968 | Accept Positive |
| Balanced evidence | 0.50 | 0.60 | 0.60 | 0.500000 | Defer / Boundary Region |
| Weak support | 0.25 | 0.40 | 0.85 | 0.135593 | Accept Negative |
Frequently Asked Questions
1) What is a Bayesian three-way decision rule?
It is a decision method with three actions instead of two. You can accept a positive class, accept a negative class, or defer judgment when uncertainty makes immediate classification too costly.
2) Why is there a defer or boundary option?
The defer region is useful when evidence is inconclusive. It lets you postpone a hard classification, request more data, or trigger manual review instead of forcing a risky yes-or-no decision.
3) What do the six loss values represent?
They describe the cost of each action under each true state. For example, λPN is the loss of accepting positive when the true state is negative. Together they shape the optimal rule.
4) Should the losses always be positive numbers?
Usually yes, because losses often represent penalties or costs. The calculator can still process other values, but unusual numbers may produce thresholds outside the standard 0 to 1 range.
5) When should I use direct posterior input?
Use it when your model already outputs a posterior probability. This is common in scoring systems, probabilistic classifiers, or Bayesian workflows where P(Positive|E) is already known.
6) When should I use Bayes components instead?
Use Bayes components when you know the prior probability and the evidence likelihoods for both states. The calculator then derives the posterior before comparing decision risks.
7) What does the Plotly graph show?
It plots expected loss for each action across posterior values from 0 to 1. The lowest curve at any point indicates the best action under your current loss matrix.
8) Why can the threshold region differ from the final recommendation?
That usually happens when the loss setup is nonstandard. The calculator always trusts the exact minimum expected loss first, then reports any mismatch as an interpretation note.