
Create a kernel function
make_kernel.RdReturns a closure K(xi, xj) suitable for use with all four psvr model
fitting functions. The returned function accepts numeric vectors of any sign,
which is required by the symmetric models (Models 2 and 4) that evaluate
K(xk, -xl).
Usage
make_kernel(
type = c("rbf", "linear", "polynomial"),
sigma = 1,
degree = 3L,
coef0 = 1
)Value
A function K(xi, xj) where xi and xj are numeric vectors of
the same length, returning a scalar kernel evaluation.
Details
The three supported kernels are:
RBF:
K(xi, xj) = exp(-‖xi - xj‖² / (2 * sigma²))Linear:
K(xi, xj) = xi · xjPolynomial:
K(xi, xj) = (xi · xj + coef0)^degree
RBF and even-degree polynomial kernels satisfy Assumption 3 of the paper
(kernel symmetry), making them compatible with the symmetric models.
The linear kernel and odd-degree polynomial kernels do not satisfy
Assumption 3 and should not be used with mape_sym_svr() or
rmspe_sym_lssvr().