
Half the squared Hellinger distance between two discrete distributions
Source:R/bnp_ghosal.R
morie_gh_hellinger2.RdRenormalises both inputs to sum to one and returns \(1 - \sum_i \sqrt{p_i q_i}\), which is one half of the squared Hellinger distance \(h^2(p, q) = \sum_i (\sqrt{p_i} - \sqrt{q_i})^2\) and lies in \([0, 1]\).
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_gh_hellinger2(V, V)
#> [1] 0