Constructs a kernel specification object used throughout kernR for
computing kernel matrices. Supports RBF (Gaussian), Matern, linear,
and polynomial kernels.
Usage
kernel_spec(
type = c("rbf", "matern", "linear", "polynomial"),
bandwidth = "median",
nu = 2.5,
degree = 2L,
offset = 1
)Arguments
- type
Character. Kernel type:
"rbf"(default),"matern","linear", or"polynomial".- bandwidth
Numeric or
"median". Lengthscale parameter for RBF and Matern kernels. If"median"(default), the median heuristic is used to select bandwidth automatically from the data.- nu
Numeric. Smoothness parameter for the Matern kernel. Common choices: 0.5 (Laplace), 1.5, 2.5, Inf (RBF). Default is 2.5.
- degree
Integer. Degree for polynomial kernel. Default is 2.
- offset
Numeric. Offset for polynomial kernel. Default is 1.
See also
Other kernel primitives:
kernel_matrix(),
resolve_bandwidth(),
select_bandwidth(),
weighted_hsic_stat()
