Skip to contents

Create a periodic kernel specification

Usage

periodic_kernel(variance = 1, length_scale = 1, period = 1)

Arguments

variance

Positive marginal variance.

length_scale

Positive scalar or numeric vector. A vector supplies one ARD length scale per input dimension and is validated against the data when the kernel is evaluated.

period

Positive period.

Value

An object of class gaussianprocesses_kernel.

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.

See also

kernel_periodic() computes the same covariance directly from parameter values, without a kernel specification.

Examples

# Monthly data with a yearly cycle.
kernel <- periodic_kernel(length_scale = 0.8, period = 12)
evaluate_kernel(kernel, c(0, 6, 12))
#>            [,1]       [,2]       [,3]
#> [1,] 1.00000000 0.04393693 1.00000000
#> [2,] 0.04393693 1.00000000 0.04393693
#> [3,] 1.00000000 0.04393693 1.00000000