kerTests (version 0.1.2)

med_sigma: Compute the Median Heuristic

Description

This function provides the most popular bandwidth of the Gaussian kernel, the median heuristic.

Usage

med_sigma(X, Y)

Arguments

X

The first samples.

Y

The second samples.

Value

Returns a numeric value, the median heuristic, which is the median of all pairwise distances among pooled observations, as a bandwidth of the kernel.

See Also

kerTests

kertests

Examples

Run this code
# NOT RUN {
## Mean difference in Gaussian distribution.
d = 100
mu = 0.2
sam = 100
n = 200
set.seed(500)
X = matrix(rnorm(d*sam), sam)
Y = matrix(rnorm(d*sam,mu), sam)

sigma = med_sigma(X, Y) # median heuristic (bandwidth)
# }

Run the code above in your browser using DataCamp Workspace