Description
For binary outcome and modelMass and referenceMass strictly between zero and one return ln(modelMass/referenceMass) for outcome one, otherwise ln((1-modelMass)/(1-referenceMass)).
Products of small probabilities can round to zero in floating-point arithmetic. Natural logarithms turn products into sums, and centering or expm1-based expressions can reduce avoidable numerical loss. A finite log weight is different from a raw probability and cannot directly represent an exact zero probability.
For binary outcome and modelMass and referenceMass strictly between zero and one return ln(modelMass/referenceMass) for outcome one, otherwise ln((1-modelMass)/(1-referenceMass)).
When to use this tool
Use Binary Observation Log Likelihood Ratio Term when you need the stated natural-log contribution or stable conversion between a finite log representation and an ordinary value.
How to use the tool and how it works
- Enter outcome, modelMass, referenceMass. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read logRatio. Use the output convention below.
For binary outcome and modelMass and referenceMass strictly between zero and one return ln(modelMass/referenceMass) for outcome one, otherwise ln((1-modelMass)/(1-referenceMass)).1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| outcome | Outcome | Required. Safe integer; minimum 0; maximum 1. |
| modelMass | Model Mass | Required. Finite number. |
| referenceMass | Reference Mass | Required. Finite number. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| logRatio | Log Ratio | Required. Finite number. |
{
"input": {
"outcome": 1,
"modelMass": 0.5,
"referenceMass": 0.25
},
"output": {
"logRatio": 0.6931471805599453
}
} Limitations and assumptions
- The ratio is model likelihood over reference likelihood for one observation. Natural logs are used; no sum over observations or endpoint convention is supplied.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Signed zero is exported as zero.
Alternative or Complementary methods
Keep long products or normalizations in the log domain when feasible. Check whether exact zeros need a separate flag and whether the final ordinary-scale result is representable.
References
Similar or alternative tools
- Normal Density Log Ratio Two Points
Return logRatio=((second-mean)^2-(first-mean)^2)/(2*deviation^2), requiring positive deviation.
- Likelihood Ratio Explicit Scale Invariance
For positive first, second, and scale return ratio=first/second and scaledRatio=(first*scale)/(second*scale).