kernel_weight {orthoDr}R Documentation

Kernel Weight

Description

Calculate the Gaussian kernel weights between rows of X1 and rows of X2.

Usage

kernel_weight(x1, x2, kernel = "gaussian", dist = "euclidean")

Arguments

x1

First data matrix

x2

Second data matrix

kernel

The kernel function, currently only using Gaussian kernel.

dist

The distance metric, currently only using the Euclidean distance.

Value

A distance matrix, with its (i, j)th element being the kernel weights for the i th row of X1 jth row of X2.

Examples

# two matrices
set.seed(1)
x1 <- matrix(rnorm(10), 5, 2)
x2 <- matrix(rnorm(6), 3, 2)
kernel_weight(x1, x2)

[Package orthoDr version 0.6.8 Index]