KL_divergence: Kullback-Leibler Divergence Estimation

Description Usage Arguments Value References Examples

View source: R/divergence.R

Description

Kullback-Leibler Divergence Estimation

Usage

1
KL_divergence(x, y, type = c("pdf", "cdf"), ...)

Arguments

x

values sampled from the distribution of interest

y

values sampled from the comparator distribution

type

using empirical p.d.f. or c.d.f.

...

options for density(...) if empirical p.d.f. applied

Value

value of KL divergence

References

Pérez-Cruz F. Kullback-Leibler divergence estimation of continuous distributions. In2008 IEEE international symposium on information theory 2008 Jul 6 (pp. 1666-1670). IEEE.

Examples

1
2
3
4
5
6
7
8
library(divKL)

x <- rnorm(100, 1)
y <- rnorm(100, 3)
KL_divergence(x, y, "pdf")
KL_divergence(x, y, "cdf")
KL_divergence(y, x, "pdf")
KL_divergence(y, x, "cdf")

TimeWz667/divKL documentation built on March 13, 2020, 4:39 p.m.