Learn R Programming

spatialEco (version 2.0-2)

divergence: divergence

Description

Kullback-Leibler Divergence (Cross-entropy)

Usage

divergence(x, y, type = c("Kullback-Leibler", "cross-entropy"))

Value

single value vector with divergence statistic

Arguments

x

a vector of integer values, defining observed

y

a vector of integer values, defining estimates

type

Type of divergence statistic c("Kullback-Leibler", "cross-entropy")

Author

Jeffrey S. Evans <jeffrey_evans@tnc.org>

Examples

Run this code
x <- round(runif(10,1,4),0)
y <- round(runif(10,1,4),0)

divergence(x, y) 
divergence(x, y, type = "cross-entropy") 

Run the code above in your browser using DataLab