kld: Kullback-Leibler divergence between discrete probability...

Description Usage Arguments Details Value

View source: R/similR.R

Description

Kullback-Leibler divergence between discrete probability distributions KLD(p||q)

Usage

1
kld(p, q)

Arguments

p

first probability distribution ("to which"), a numeric vector, no NAs

q

second probability distribution ("from which"), a numeric vector of same length as p, no NAs

Details

Assumes that both p and q are normalized (sum(p)=sum(q)=1). Note that by definition the Kullback-Leibler divergence is asymmetric: KLD(p||q) is not equal to KLD(q||p).

Value

KLD(p||q), a numeric value


rushkin/similR documentation built on Sept. 26, 2019, 10:42 p.m.