How far one piece of evidence should move a belief.

One habit runs through every other lab on this site: state a belief as a number, move it only as far as the evidence allows, and know what a piece of information is worth before paying for it. I wanted to see that habit done exactly, with every value kept as a fraction and no rounding hidden inside a decimal.

A unit square cut across by three priors and, inside each column, by three signals, so the area of every rectangle is an exact joint probability. Each signal seen lays one direction of hatching; the pigment blocks, where all three cross, are the posterior.

The update and the decision

Write hypotheses with priors that sum to one, evidence with a likelihood under each hypothesis, actions with payoffs, and past forecasts with their outcomes. The page updates the belief after every item as an exact fraction, values every action, prices perfect and sample information, and scores the forecasts. Evidence items are assumed conditionally independent given each hypothesis.

The scenario you edit

The hypotheses, evidence, payoffs and forecasts are made up, and everything runs in your browser: nothing you type is stored or sent.

Priors, likelihoods, payoffs and forecasts are quoted strings in the JSON source so that nothing passes through binary floating point. Loading an example or resetting replaces your edits and clears the results.

Edit the hypotheses, evidence, actions and forecasts

Write every probability as a quoted decimal such as "0.01" or a fraction such as "1/100". Each likelihoods and payoffs object needs exactly one entry per hypothesis id. Evidence is applied in source order. A forecast outcome is the number 0 or 1.

2 to 8 hypotheses with priors summing exactly to 1; 0 to 12 evidence items; 0 to 8 actions; 0 to 60 forecasts; 50,000 source characters. Probabilities lie in [0, 1] with at most 12 decimal places, or are fractions a/b with at most 12 digits each. Payoffs have at most 10 integer digits and 2 decimals. Unknown and duplicate JSON fields are refused.

JavaScript is required to compute. No calculation has run.

Method and limits

Exact arithmetic

Every probability and payoff is parsed from its quoted string into a reduced fraction of arbitrary-precision integers. Addition, multiplication, division and comparison are exact. The page shows a decimal rounded half away from zero at six places beside the fraction; the fraction is the value. A zero normaliser or a zero odds denominator is reported as an abstention or as undefined, before any division.

The single floating-point quantity is the logarithmic score, computed in IEEE-754 double precision with the natural logarithm and labelled as such. A forecast of exactly 0 or 1 that met the opposite outcome makes the log score undefined; the page reports that word rather than an infinite number.

Updating, decision and information value

Updating: posterior(h) = current(h) * likelihood(e | h) / Z with Z = sum over hypotheses, applied to each evidence item in source order under the stated assumption that items are conditionally independent given the hypothesis. The order view takes every order at once: after k items the posterior depends only on the set of items applied, so the 2ⁿ sets of first items stand for all n! orders, at most 4,096 sets for 12 items. Joint weights share one denominator per hypothesis, so every range is found with whole-number arithmetic and reduced only for display. In the three-hypothesis example the north supplier ranges from 4/17 to 2/3 after one item, depending on which item comes first, and every order ends at 8/25. With two hypotheses the Bayes factor likelihood(e | h1) / likelihood(e | h2) and the posterior odds are reported. A hypothesis at exactly 0 or 1 is flagged because no later evidence can move it. In the default example a prior of 1/100 with likelihoods 9/10 and 1/10 gives 1/12 after one positive result and 9/20 after two.

Decision: EV(a) = sum_h p(h) payoff(a, h) under the prior and under the final posterior. The best action is the exact maximum; equal values are listed together as a tie. EVPI = sum_h p(h) max_a payoff(a, h) - max_a EV(a). EVSI treats each evidence item alone as a binary signal from the prior, observed with its stated likelihood under each hypothesis or otherwise its complement, and equals the expected value of deciding after that signal minus the value of deciding now. This binary-signal reading is a modelling convention. Each EVSI is checked to lie between 0 and EVPI. The joint value observes every item at once: each of the 2ⁿ patterns of observed and not observed is weighted by the prior times one likelihood or complement per item, the best action is taken under each pattern, and the sum minus the value of deciding now is the joint EVSI, checked to lie between the largest single-item EVSI and EVPI. In the default example it is 279/125, against 18/25 for either test alone and an EVPI of 3. The export marks an item decisionRelevant when its EVSI is positive, that is, when some branch of the signal would change the best action; an item can move the posterior a long way and still be irrelevant to the decision at hand. The leading posterior is chosen by exact comparison and an exact tie lists every member.

Calibration: the Brier score (Brier 1950) is the mean squared difference between forecast and outcome. The Murphy decomposition (Murphy 1973) groups forecasts by their exact distinct values so that Brier = reliability - resolution + uncertainty holds exactly. A second grouping into ten bins at tenths, with a forecast of exactly 1 in the last bin, feeds the reliability diagram; its within-bin remainder, which can be positive or negative, is reported so the same identity still reconciles exactly.

Source schema and limits

Required top-level fields: fictional: true, scenario, hypotheses, evidence, actions, forecasts. Each hypothesis has id, label, prior; each evidence item id, label, likelihoods; each action id, label, payoffs; each forecast id, label, probability, outcome. Likelihood and payoff objects carry exactly one entry per hypothesis id. Unknown, missing or duplicate fields are errors; JSON nesting is limited to 16 levels and arrays must be dense.

Bounds: 2 to 8 hypotheses, 0 to 12 evidence items, 0 to 8 actions, 0 to 60 forecasts, 50,000 source characters, scenario 120 characters, labels 80 characters. Probabilities must lie in [0, 1]: a decimal string therefore has one integer digit and at most 12 decimal places, or a fraction a/b has positive b and at most 12 digits in each of a and b. Payoffs are decimal strings with at most 10 integer digits and 2 decimals in currency units. Text cannot contain control, zero-width or bidirectional override characters. Identifiers start with an ASCII letter and have at most 24 letters, digits, underscores or hyphens; PRIOR is reserved for step 0.

Scope, implementation and checks

The page does arithmetic on numbers you supply: every prior, likelihood and base rate comes from you, and the best action is a computed maximum. Nothing here is medical or financial advice. The medical-sounding default example is the textbook screening problem, used for its arithmetic. Calibration on a handful of forecasts is noisy, and the forecasts here are worked examples rather than a record of mine. Dependent evidence, continuous hypotheses, utility curves, risk attitudes and the cost of gathering evidence are outside the model.

The engine and the interface are plain JavaScript with no dependencies; the same engine runs in Node and the browser. Edits disappear on reload. A download contains the complete supplied JSON, every exact fraction, the order ranges and the joint value of information, and replays with RV_DECISIONS.analyze(exactInputText).

I checked the engine against hand-worked values: the 1/12 and 9/20 posteriors, an EVPI of 3, an EVSI of 18/25 and a four-forecast Brier score of 79/400. Independent floating-point recomputations of sequential updating, EV and EVPI, an exact recomputation of EVSI from the binary-signal definition, and the exact Murphy identity on random forecast sets agree with it. Those checks cover the arithmetic.