Skip to contents

Csiszar (1967) f-divergence D_f(p || q) = sum q f(p/q)

Usage

FDiverg(p, q, f = "kl", f_inf = NULL, normalise = TRUE)

Arguments

p, q

non-negative weights of equal length

f

a convex generator with f(1) = 0, or one of "kl", "rkl", "tv", "chi2", "hellinger", "js"

f_inf

recession constant charged against mass p places where q is zero; defaults to the exact value for a named generator

normalise

divide p and q by their totals first

Value

list(divergence, estimate, terms, support, generator, f_inf, n)

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
FDiverg(V, V)
#> $divergence
#> [1] 0
#> 
#> $estimate
#> [1] 0
#> 
#> $terms
#> [1] 0 0 0 0 0 0 0 0
#> 
#> $support
#> [1] 0
#> 
#> $generator
#> [1] "kl"
#> 
#> $f_inf
#> [1] Inf
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Csiszar (1967) f-divergence, sum q f(p/q)"
#>