kerTests (version 0.1.4)

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)

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.

Arguments

X

The first samples.

Y

The second samples.

See Also

kerTests-package, kertests

Examples

Run this code
## 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 DataLab