Skip to contents

Multiplies a covariance kernel by a positive scalar. The scalar is retained as a named parameter and can therefore be optimized together with parameters of nested kernels.

Usage

scale_kernel(kernel, scale = 1)

Arguments

kernel

A Gaussian-process kernel specification.

scale

Positive scalar multiplier.

Value

A composite kernel specification.

Stability

Stable: from version 1.0.0 this interface changes incompatibly only in a major release, after a deprecation period. Results and options that concern an experimental model class, kernel, or argument follow that interface's tier. See gaussianprocesses-package for the policy.

Examples

kernel <- scale_kernel(rbf_kernel(), scale = 3)
all.equal(
  evaluate_kernel(kernel, 1:3),
  3 * evaluate_kernel(rbf_kernel(), 1:3)
)
#> [1] TRUE