Learn R Programming

philentropy (version 0.8.0)

jensen_shannon: Jensen-Shannon distance (lowlevel function)

Description

The lowlevel function for computing the jensen_shannon distance.

Usage

jensen_shannon(P, Q, testNA, unit)

Arguments

P

a numeric vector storing the first distribution.

Q

a numeric vector storing the second distribution.

testNA

a logical value indicating whether or not distributions shall be checked for NA values.

unit

type of log function. Option are

  • unit = "log"

  • unit = "log2"

  • unit = "log10"

Author

Hajk-Georg Drost

Examples

Run this code
jensen_shannon(P = 1:10/sum(1:10), Q = 20:29/sum(20:29), testNA = FALSE, unit = "log2")

Run the code above in your browser using DataLab