Skip to contents

Renormalises both inputs to sum to one and returns \((\alpha - 1)^{-1} \log \sum_i p_i^{\alpha} q_i^{1 - \alpha}\). The order alpha must differ from 1; no check is performed.

Usage

morie_gh_renyi(p, q, alpha = 0.5)

Arguments

p

numeric vector of non-negative weights; renormalised internally

q

numeric vector of non-negative weights on the same support; renormalised internally

alpha

order of the divergence, not equal to 1; defaults to 0.5

Value

numeric scalar divergence in nats

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_gh_renyi(V, V)
#> [1] 0