powered by
Calculate the Gaussian kernel distance between rows of X1 and rows of X2. As a result, this is an extension to the stats::dist() function.
stats::dist()
dist_cross(x1, x2)
A distance matrix with its (i, j)th element being the Gaussian kernel distance between ith row of X1 jth row of X2.
X1
X2
First data matrix
Second data matrix
# two matrices set.seed(1) x1 <- matrix(rnorm(10), 5, 2) x2 <- matrix(rnorm(6), 3, 2) dist_cross(x1, x2)
Run the code above in your browser using DataLab