Description
Return log2(original/quantized) for both probabilities in (0, 1].
Information units depend on the logarithm base: base two gives bits and the natural logarithm gives nats. A derivative or conversion factor must preserve its stated variable and base.
Return log2(original/quantized) for both probabilities in (0, 1].
When to use this tool
Use Probability Quantization Surprisal Error when you need an explicit information-unit conversion or surprisal component.
How to use the tool and how it works
- Enter original, quantized. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read errorBits. Use the output convention below.
Return log2(original/quantized) for both probabilities in (0, 1].1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| original | Original | Required. Finite number. |
| quantized | Quantized | Required. Finite number. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| errorBits | Quantized surprisal minus original surprisal in bits; can be signed. | Required. Finite number. |
json
{
"input": {
"original": 0.5,
"quantized": 0.25
},
"output": {
"errorBits": 1
}
} Limitations and assumptions
- This is quantized surprisal minus original surprisal in bits, not absolute error or an estimate of a complete distribution's coding loss.
- 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. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Check the probability domain and logarithm convention of the complete measure before combining values.
References
Similar or alternative tools
- Information: Log Loss Probability Floor Bias
Apply max(probability, floor) with both inputs in (0, 1].
- Pointwise Log Likelihood Ratio
Return ln(firstProbability/secondProbability)/ln(logBase).