dist_one_many {philentropy} | R Documentation |
Distances and Similarities between One and Many Probability Density Functions
Description
This functions computes the distance/dissimilarity between one probability density functions and a set of probability density functions.
Usage
dist_one_many(
P,
dists,
method,
p = NA_real_,
testNA = TRUE,
unit = "log",
epsilon = 1e-05
)
Arguments
P |
a numeric vector storing the first distribution. |
dists |
a numeric matrix storing distributions in its rows. |
method |
a character string indicating whether the distance measure that should be computed. |
p |
power of the Minkowski distance. |
testNA |
a logical value indicating whether or not distributions shall be checked for |
unit |
type of
|
epsilon |
epsilon a small value to address cases in the distance computation where division by zero occurs. In
these cases, x / 0 or 0 / 0 will be replaced by |
Value
A vector of distance values
Examples
set.seed(2020-08-20)
P <- 1:10 / sum(1:10)
M <- t(replicate(100, sample(1:10, size = 10) / 55))
dist_one_many(P, M, method = "euclidean", testNA = FALSE)