chisqDistance: Chi-square distance between vectors

Description Usage Arguments Value Examples

View source: R/04_comparison_metrics.R

Description

Computes the chi-squared distance between each element of a pair of vectors which must be of the same length. Good for comparing color histograms if you don't want to weight by color similarity. Probably hugely redundant; alas.

Usage

1

Arguments

a

Numeric vector.

b

Numeric vector; must be the same length as a.

Value

Chi-squared distance, (a - b)^2/(a + b), between vectors a and b. If one or both elements are NA/NaN, contribution is counted as a 0.

Examples

1
colordistance:::chisqDistance(rnorm(10), rnorm(10))

Example output

[1] 9.498323

colordistance documentation built on March 21, 2021, 1:06 a.m.