kernels: Multivariate RBF Kernel

Description Usage Arguments Details Value Examples

Description

Designed to be partially specified. (see examples)

Usage

1
2
3
SE(X, sigma = 1, rho = median(as.matrix(dist(t(X)))), jitter = 1e-10)

LINEAR(X, sigma = 1, c = rep(0, nrow(X)))

Arguments

X

covariate (dimension Q x N; i.e., covariates x samples)

sigma

scalar parameter

rho

scalar bandwidth parameter

jitter

small scalar to add to off-diagonal of gram matrix (for numerical underflow issues)

c

vector parameter defining intercept for linear kernel

Details

Gram matrix G is given by

SE (squared exponential):

G = σ^2 * exp(-[(X-c)'(X-c)]/(s*ρ^2))

LINEAR:

G = σ^2*(X-c)'(X-c)

Value

Gram Matrix (N x N) (e.g., the Kernel evaluated at each pair of points)

Examples

1
2
3
4
5
6
7
  # Create Partial for use with basset
  K <- function(X) SE(X, 2, .2)
  
  # Example use
  X <- matrix(rnorm(10), 2, 5)
  G <- K(X)
  G # this is the gram matrix (the kernel evaluated on a finite set of points)

jsilve24/mongrel documentation built on Jan. 27, 2022, 9:54 p.m.