Skip to content

Main content

Bhattacharyya Log Affinity Term Tool

Calculate bhattacharyya log affinity term from explicit caller-supplied inputs.

Loading tool…

Description

Require affinity in (0, 1] and return -ln(affinity) as distance.

Divergences and information densities compare probabilities on a common support. A weighted cell contribution and an unweighted logarithmic ratio differ, and zero-support cases require explicit limits.

Require affinity in (0, 1] and return -ln(affinity) as distance.

When to use this tool

Use Bhattacharyya Log Affinity Term when you need one precisely defined information-comparison term.

How to use the tool and how it works

  1. Enter affinity. 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 distance. Use the output convention below.

Require affinity in (0, 1] and return -ln(affinity) as distance.1

Input fieldMeaning and unitsAccepted input
affinityAffinityRequired. Finite number; maximum 1; strictly above 0.
Output fieldInterpretationReturned shape
distanceDistanceRequired. Finite number.
json
{
  "input": {
    "affinity": 0.5
  },
  "output": {
    "distance": 0.6931471805599453
  }
}

Limitations and assumptions

  • This is the logarithm of a supplied complete Bhattacharyya affinity; a single symbol term is not automatically the full affinity and zero is rejected.
  • 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

Align and validate complete distributions before summing terms or interpreting a full divergence or dependence measure.

References

  1. Calculation and input contract: information/bhattacharyya-log-affinity-term — tool.io

Similar or alternative tools

  • Hellinger Affinity Symbol Term

    Return sqrt(first × second) through separate square roots for affinity and half the squared difference of those roots for squaredDistanceTerm.

  • Jensen Shannon One Bin Contribution

    Validate first and second in [0, 1], use their mean as reference, and return half-weighted base-two relative-entropy terms, treating zero terms as zero.