medianheuristic {eummd} | R Documentation |
Compute the median heuristic
Description
Computes the inverse of the median difference of all distinct pairs in vectors or matrices.
Usage
medianheuristic(X, Y = NULL, kernel = c("Laplacian", "Gaussian"), fast = FALSE)
Arguments
X |
Numeric vector or matrix of length |
Y |
Numeric vector or matrix of length |
kernel |
String, either |
fast |
Boolean; if |
Details
Computes median of differences md
using mediandiff
and then returns 1 / md
. See mediandiff
for details.
Value
A scalar, the inverse of the median of all pairwise differences.
See Also
mediandiff
Examples
X <- c(7.1, 1.2, 4.3, 0.4)
Y <- c(5.5, 2.6, 8.7)
mh <- medianheuristic(X, Y, kernel="Laplacian", fast=TRUE)
#using fast method, Gaussian kernel, loglinear in number of observations
mh <- medianheuristic(X, Y, fast=TRUE, kernel="Gaussian")
#using naive method (default), with Laplacian kernel
mh <- medianheuristic(X, Y)
[Package eummd version 0.1.9 Index]