Skip to contents

p -> 0, so zero-density points contribute nothing. This is a density inside the log, so unlike eq (3.11) the result may be negative.

Usage

DiffEnt(pdf = NULL, x = NULL, lower = -Inf, upper = Inf)

Arguments

pdf

Passed to .morie_rg_pdfint.

x

Optional; may be NULL. Coerced to numeric by the body, with as.numeric.

lower

Passed to .morie_rg_pdfint. Defaults to -Inf.

upper

Passed to .morie_rg_pdfint. Defaults to Inf.

Value

A vector, from c.

Examples

xg <- seq(-6, 6, by = 0.01)
DiffEnt(x = xg, p = dnorm(xg))
#> $entropy
#> [1] 2.047096
#> 
#> $units
#> [1] "bits"
#> 
#> $method
#> [1] "Rangayyan (2024) eq. (3.6)"
#> 
#> $pdf_mass
#> [1] 1
#> 
#> $pdf_mass_ok
#> [1] TRUE
#>