kl.diri: Kullback-Leibler divergence and Bhattacharyya distance...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/kl.diri.R

Description

Kullback-Leibler divergence and Bhattacharyya distance between two Dirichlet distributions.

Usage

1
kl.diri(a, b, type = "KL")

Arguments

a

A vector with the parameters of the first Dirichlet distribution.

b

A vector with the parameters of the second Dirichlet distribution.

type

A variable indicating whether the Kullback-Leibler divergence ("KL") or the Bhattacharyya distance ("bhatt") is to be computed.

Details

Note that the order is important in the Kullback-Leibler divergence, since this is asymmetric, but not in the Bhattacharyya distance, since it is a metric.

Value

The value of the Kullback-Leibler divergence or the Bhattacharyya distance.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <[email protected]> and Giorgos Athineou <[email protected]>

References

Ng Kai Wang, Guo-Liang Tian and Man-Lai Tang (2011). Dirichlet and related distributions: Theory, methods and applications. John Wiley \& Sons.

See Also

diri.est, diri.nr

Examples

1
2
3
4
5
6
7
library(MASS)
a <- runif(10, 0, 20)
b <- runif(10, 1, 10)
kl.diri(a, b)
kl.diri(b, a)
kl.diri(a, b, type = "bhatt")
kl.diri(b, a, type = "bhatt")

Compositional documentation built on June 4, 2018, 5:04 p.m.