klDiv {PoolBal} | R Documentation |
Compute the Kullback-Leibler divergence
Description
Computes the Kullback-Leibler divergence for two arbitrary densities f1 and f2.
Usage
klDiv(f1, f2, lower = 0, upper = 1)
Arguments
f1 |
density function of a real-valued random variable |
f2 |
density function of a real-values random variable |
lower |
real value, the lower bound of integration |
upper |
real value, the upper bound of integration |
Details
Given lower and upper bounds, this function integrates the expression for the Kullback-Leibler divergence KL(f1|f2).
Value
A real value.
Author(s)
Chris Salahub
Examples
klDiv(dunif, function(x) dbeta(x, 0.5, 1))
[Package PoolBal version 0.1-0 Index]