kernel-arith {bases} | R Documentation |
Kernel arithmetic
Description
Kernel functions (see ?kernels
) may be multiplied by constants,
multiplied by each other, or added together.
Usage
## S3 method for class 'kernel'
x * k2
## S3 method for class 'kernel'
k1 + k2
Arguments
x |
a numeric or a |
k2 |
a |
k1 |
a |
Value
A new kernel function, with class c("kernel", "function")
.
Examples
x = seq(-1, 1, 0.5)
k = k_rbf()
k2 = k_per(scale=0.2, period=0.3)
k_add = k2 + 0.5*k
print(k_add)
image(k_add(x, x))
[Package bases version 0.1.2 Index]