Calculators

Triangular Discrimination Calculator

Calculate triangular discrimination between probability distributions with automatic normalization of counts or weights, privately in your browser.

Enter matching non-negative counts, weights or probabilities. Each vector is normalized independently to sum to 1. Separate values with spaces, commas or semicolons. Each vector allows 1–10000 values and 200000 characters; nonzero values must be between 1e-100 and 1e100. At least one value per vector must be positive. Coordinates must represent the same categories in the same order. Calculation runs locally in your browser.

Your triangular discrimination will appear here.

How triangular discrimination works

Triangular discrimination is Δ(P, Q) = Σ(Pᵢ − Qᵢ)² / (Pᵢ + Qᵢ). A shared zero contributes zero. Each input vector is normalized independently to sum to one, so proportional counts give zero. The result ranges from 0 for identical distributions to 2 for disjoint support. For (1, 0) and (0, 1), the result is 2; for (1, 3) and (2, 6), it is 0. This symmetric divergence compares proportions rather than absolute totals. Coordinates must refer to the same categories in the same order. It is not the Pearson chi-square test statistic and does not provide a p-value. Enter 1 to 10000 non-negative decimal values separated by spaces, commas or semicolons, up to 200000 characters per vector. Scientific notation is supported; nonzero values must be between 1e-100 and 1e100. Each vector must contain a positive value. Scaled normalization and compensated summation reduce numeric error; results show up to 12 significant digits and very small differences may round away. All calculations run locally in your browser.

Frequently Asked Questions

Everything you need to know about this tool, how it works, and privacy.

What does triangular discrimination measure?

It is a symmetric divergence between matching probability distributions: Σ(P − Q)²/(P + Q). It ranges from 0 to 2, with larger values indicating greater differences.

Must my values sum to one?

No. Non-negative counts or weights are normalized independently. Each vector must contain at least one positive value. Proportional vectors therefore give zero.

Are zero values allowed?

Yes. Coordinates where both distributions are zero contribute zero. Disjoint support gives the maximum value of 2.

Is this a chi-square test?

No. This calculator reports a descriptive divergence, not a test statistic, confidence level or p-value.

What input limits apply?

Use equal-length vectors of 1 to 10000 values and at most 200000 characters each. Nonzero values must lie between 1e-100 and 1e100. Results use floating-point arithmetic and up to 12 significant digits.