Skip to content

Main content

Pointwise Log Likelihood Ratio Tool

Calculate pointwise log likelihood ratio from explicit caller-supplied inputs.

Loading tool…

Description

Return ln(firstProbability/secondProbability)/ln(logBase).

Pointwise information gains compare the probability assigned to one observation under two models or states. Their sign can be negative even when an associated average divergence is nonnegative.

Return ln(firstProbability/secondProbability)/ln(logBase).

When to use this tool

Use Pointwise Log Likelihood Ratio when you need a supplied single-event probability-ratio term.

How to use the tool and how it works

  1. Enter firstProbability, secondProbability, logBase. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read logRatio. Use the output convention below.

Require both probabilities in (0, 1] and logBase > 1. Return ln(firstProbability/secondProbability)/ln(logBase).1

Input fieldMeaning and unitsAccepted input
firstProbabilityFirst ProbabilityRequired. Finite number; maximum 1; strictly above 0.
secondProbabilitySecond ProbabilityRequired. Finite number; maximum 1; strictly above 0.
logBaseLogarithm base; base 2 gives bits and base e gives nats under conventional bases greater than one.Required. Finite number; strictly above 1.
Output fieldInterpretationReturned shape
logRatioLog RatioRequired. Finite number.
json
{
  "input": {
    "firstProbability": 0.5,
    "secondProbability": 0.125,
    "logBase": 2
  },
  "output": {
    "logRatio": 2
  }
}

Limitations and assumptions

  • The signed result concerns one observation; no likelihood model, normalization across observations, or statistical test 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. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Validate the full models and aggregate over the intended distribution before interpreting an overall gain.

References

  1. Calculation and input contract: information/pointwise-log-likelihood-ratio — tool.io

Similar or alternative tools