KernelMatern {BKTR} | R Documentation |
R6 class for Matern Kernels
Description
R6 class for Matern Kernels
Super class
BKTR::Kernel
-> KernelMatern
Public fields
lengthscale
The lengthscale parameter instance of the kernel
smoothness_factor
The smoothness factor of the kernel
has_dist_matrix
Identify if the kernel has a distance matrix or not
Methods
Public methods
Inherited methods
Method new()
Create a new KernelMatern
object.
Usage
KernelMatern$new( smoothness_factor = 5, lengthscale = KernelParameter$new(2), kernel_variance = 1, jitter_value = NULL )
Arguments
smoothness_factor
Numeric: The smoothness factor of the kernel (1, 3 or 5)
lengthscale
KernelParameter: The lengthscale parameter instance of the kernel
kernel_variance
Numeric: The variance of the kernel
jitter_value
Numeric: The jitter value to add to the kernel matrix
Method get_smoothness_kernel_fn()
Method to the get the smoothness kernel function for a given integer smoothness factor
Usage
KernelMatern$get_smoothness_kernel_fn()
Returns
The smoothness kernel function
Method core_kernel_fn()
Method to compute the core kernel's covariance matrix
Usage
KernelMatern$core_kernel_fn()
Returns
The core kernel's covariance matrix
Method clone()
The objects of this class are cloneable with this method.
Usage
KernelMatern$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
# Create a new Matern 3/2 kernel
k_matern <- KernelMatern$new(smoothness_factor = 3)
# Set the kernel's positions
positions_df <- data.frame(x=c(-4, 0, 3), y=c(-2, 0, 2))
k_matern$set_positions(positions_df)
# Generate the kernel's covariance matrix
k_matern$kernel_gen()
[Package BKTR version 0.1.1 Index]