kernCreate: Initialise a kernel structure.

Description Usage Arguments Details Value See Also Examples

View source: R/kernFunctions.R

Description

Initialise a kernel structure.

Usage

1
  kernCreate(x, kernType, kernOptions=NULL)

Arguments

x

If list, array or matrix: input data values (from which kernel will later be computed). If scalar: input dimension of the design matrix (i.e. number of features in the design matrix).

kernType

Type of kernel to be created, some standard types are 'rbf', 'white', 'sim' and 'disim'. If a list of the form list(type='cmpnd', comp=c('rbf', 'rbf', 'white')) is used a compound kernel based on the sum of the individual kernels will be created. Parameters can be passed to kernels using type list(type='parametric', options=list(opt=val), realType=...), where realType is the type that would be used otherwise.

kernOptions

(optional) list of kernel options

Details

kern <- kernCreate(X, type) input points and a kernel type.

kern <- kernCreate(dim, type) creates a kernel matrix structure given the dimensions of the design matrix and the kernel type.

The *KernParamInit functions perform initialisation specific to different types of kernels. They should not be called directly.

Value

kern

The kernel structure.

See Also

kernDisplay, modelTieParam.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Create a multi kernel with two rbf blocks with bounded inverse widths
invWidthBounds <- c(0.5, 2)
kernType <- list(type="multi", comp=list())
for (i in 1:2)
  kernType$comp[[i]] <- list(type="parametric", realType="rbf",
                              options=list(isNormalised=TRUE,
                                inverseWidthBounds=invWidthBounds))
kern <- kernCreate(1, kernType)

# Tie the inverse with parameters of the component RBF kernels
kern <- modelTieParam(kern, list(tieWidth="inverseWidth"))
kernDisplay(kern)

ahonkela/tigre documentation built on Aug. 6, 2021, 12:08 p.m.