kernel_matrix: Kernel Matrix Computation

Description Usage Arguments Details Value Author(s) Examples

View source: R/kernel_matrix.R

Description

Computes kernel matrices for Gaussian and Hermite kernels.

Usage

1
2
3
4
5
6
7
kernel_matrix(
  x,
  y = x,
  kernel = c("gauss", "hermite"),
  sigma = 1,
  hermite_rank = 3
)

Arguments

x

Numeric vector.

y

Numeric vector, default is x.

kernel

Either "gauss" or "hermite".

sigma

Numeric value of the kernel variance. Default is 1.

hermite_rank

Rank of the Hermite kernel. Default is 3. Ignored, when the Gaussian kernel is chosen.

Details

The function computes a matrix in the form of (K_{ij})_{(i,j)} = K(x_i, x_j) or (K_{ij})_{(i,j)} = K(x_i, y_j) for a kernel function K depending if a second vector was given. The following two kernels are offered:

Value

A numeric kernel matrix.

Author(s)

Christoph L. Koesner

Examples

1
2
3
x <- rnorm(10)
kernel_matrix(x, kernel = "gauss", sigma = 4)
kernel_matrix(x, kernel = "hermite", sigma = 4, hermite_rank = 3)

KernelICA documentation built on March 1, 2021, 5:08 p.m.