KernelAddComposed {BKTR}R Documentation

R6 class for Kernels Composed via Addition

Description

R6 class automatically generated when adding two kernels together.

Super classes

BKTR::Kernel -> BKTR::KernelComposed -> KernelAddComposed

Methods

Public methods

Inherited methods

Method new()

Create a new KernelAddComposed object.

Usage
KernelAddComposed$new(left_kernel, right_kernel, new_name)
Arguments
left_kernel

Kernel: The left kernel to use for composition

right_kernel

Kernel: The right kernel to use for composition

new_name

String: The name of the composed kernel

Returns

A new KernelAddComposed object.


Method clone()

The objects of this class are cloneable with this method.

Usage
KernelAddComposed$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples


# Create a new additive kernel
k_rq_plus_per <- KernelAddComposed$new(
  left_kernel = KernelRQ$new(),
  right_kernel = KernelPeriodic$new(),
  new_name = 'SE + Periodic Kernel'
)
# Set the kernel's positions
positions_df <- data.frame(x=c(-4, 0, 3), y=c(-2, 0, 2))
k_rq_plus_per$set_positions(positions_df)
# Generate the kernel's covariance matrix
k_rq_plus_per$kernel_gen()


[Package BKTR version 0.1.1 Index]