kernelEval: Evaluation of kernels

Description Usage Arguments Details Value

View source: R/kerneval.R

Description

Evaluation of kernels

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
kernelEval(tZ, kernel = c("linear", "poly", "gaussian"), ...)

linKernelEval(tZ)

gaussKernelEval(tZ, sigma = 1)

polyKernelEval(tZ, a = 0, d = 2)

genericKernelEval(tZ, kernel_func, ...)

gaussKernelEval_multipleRhos(tZ, rho)

polyKernelEval_multipleRhos(tZ, rho, d = 2)

Arguments

tZ

a P x N matrix of genomic covariates (i.e., the usual data array Z transposed)

kernel

which kernel is evaluated by kerneval. Possible values include currently implemented kernels designated by a character string "linear", "poly" and "gaussian". Otherwise can also be a user-defined function (see kernel_func).

...

other arguments to be passed to be passed to the evaluated kernel function.

sigma

standard-deviation parameter for the "gaussian" kernel.

a

TODO of the polynomial for the "poly". Default is 0

d

power of the polynomial. Default is 2 (quadratic kernel).

kernel_func

a function, whose first argument should be tZ

rho

either a single rho to evaluate the kernel at, or a vector of rhos

Details

kernelEval works only for gaussian, polynomial and linear kernels currently.

genericKernelEval

For polyKernelEval_multipleRhos, one should have rho > 0 to get basis of monomials up to degree d

Value

kernelEval, linKernelEval, gaussKernelEval, and genericKernelEval return an N x N matrix with entries K(Z[i,], Z[j,]) [persons i,j]

gaussKernelEval_multipleRhos and polyKernelEval_multipleRhos return a matrix of dimension Q x N^2, where Q is the length of rho, each row corresponds to a rho (puns!) to get the actual kernel matrix associated with a particular value of rho, if output is G, take matrix(G[i,], N)


kernscr documentation built on Aug. 21, 2019, 1:05 a.m.