bayes
Update a binary probability from two conditional evidence likelihoods.
Contract
Likelihoods describe the supplied observation under each hypothesis, conditional on earlier evidence. Impossible evidence is an error. This calculation does not append a journal revision.
Fields
| Field | Type | Required |
|---|---|---|
given_h | Probability | Yes |
given_not_h | Probability | Yes |
op | "bayes" | Yes |
prior | Probability | Yes |
This operation needs no existing question or forecast. Use --memory for a calculation-only session.
Request
Send this object on one line. It is expanded below for readability.
{
"version": 1,
"id": "example",
"command": {
"op": "bayes",
"prior": 0.3,
"given_h": 0.8,
"given_not_h": 0.2
}
}
Response
This response is generated by executing the example against the current binary. Commit timestamps, when present, are shown as <runtime UTC seconds>; the actual protocol returns integer UTC seconds.
{
"version": 1,
"id": "example",
"result": {
"posterior": 0.631578947368421
}
}
Verification
The documentation gate executes the setup and request, then checks the following result fields against independently specified expectations:
JSON pointer within result | Expected |
|---|---|
/posterior | 0.631578947368421 |
Float comparisons use a 1e-12 tolerance. Request schema validation and cross-record validation still apply. See errors and recovery for failure handling.