divKL: Calculator of Kullack-Leibler divergence

Description Usage Arguments Value

Description

divKL accepts a pair of vectors of probability vectors that it interprets as defining a pair of discrete distributions and uses the values to compute Kullback-Leibler divergence between the distributions. The probability vectors must be normalized and be of equal length. The logarithm base can be provided as an optional argument to base. The default base is 2 so that the unit is the bit.

Usage

1
divKL(pA, pB, base = 2)

Arguments

pA

Vector of probabilities definining one distribution,

pB

Vector of probabilities defining another distribution.

base

The logarithm base to use. Common values are 2 for a value in bits and natural constant e for a value in nats.

Value

Kullback-Leibler divergence between the given distributions.


vreuter/SwissR documentation built on May 14, 2019, 11:29 a.m.