Computes kernel matrices for Gaussian and Hermite kernels.
kernel_matrix(
x,
y = x,
kernel = c("gauss", "hermite"),
sigma = 1,
hermite_rank = 3
)
Numeric vector.
Numeric vector, default is x
.
Either "gauss"
or "hermite"
.
Numeric value of the kernel variance. Default is 1.
Rank of the Hermite kernel. Default is 3. Ignored, when the Gaussian kernel is chosen.
A numeric kernel matrix.
The function computes a matrix in the form of
Gaussian Kernel:
Hermite Kernel:
# NOT RUN {
x <- rnorm(10)
kernel_matrix(x, kernel = "gauss", sigma = 4)
kernel_matrix(x, kernel = "hermite", sigma = 4, hermite_rank = 3)
# }
Run the code above in your browser using DataLab