Learn R Programming

gptk (version 1.06)

kernCompute: Compute the kernel given the parameters and X.

Description

Compute the kernel given the parameters and X.

Usage

kernCompute(kern, x, x2)
kernDiagCompute(kern, x)

Arguments

kern
kernel structure to be computed.
x
depending on the number of inputs, x can be the input data matrix (rows are data points) to the kernel computation, or the first input matrix to the kernel computation (forms the rows of the kernel).
x2
second input matrix to the kernel computation (forms the columns of the kernel).

Value

  • Kcomputed elements of the kernel structure.
  • Kdvector containing computed diagonal elements of the kernel structure.

Details

K <- kernCompute(kern, x) computes a kernel matrix for the given kernel type given an input data matrix.

K <- kernCompute(kern, x1, x2) computes a kernel matrix for the given kernel type given two input data matrices, one for the rows and one for the columns. K <- kernDiagCompute(kern, x) computes the diagonal of a kernel matrix for the given kernel. K <- *X*kernCompute(kern1, kern2, x) K <- *X*kernCompute(kern1, kern2, x1, x2) same as above, but for cross combinations of two kernels, kern1 and kern2.

See Also

kernCreate

Examples

Run this code
kern <- kernCreate(1, 'rbf')
K <- kernCompute(kern, as.matrix(3:8))

Run the code above in your browser using DataLab