Skip to contents

Currently supports a data-driven bandwidth selection for the Gaussian kernel, with the following fixed settings for other kernels:

  • Linear kernel: no parameters.

  • Polynomial kernel: cubic polynomial (intercept = 1, degree = 3).

  • Matern kernel: length-scale fixed at 1.

Usage

auto_select_kernel_params(kernel, Y)

Arguments

kernel

Kernel function to use.

Y

A numeric matrix of dimension (n, p), where each column corresponds to the observed trajectory of a variable. Rows align with obs_time.

Value

A list of length p, where each element is a named list of parameters for a specific variable (e.g., list(bandwidth = 1) for Gaussian kernel). If the list has length 1, the same parameter set is used for all variables.

Examples

set.seed(1)
obs_time <- seq(0, 1, length.out = 10)
Y <- cbind(sin(2 * pi * obs_time), cos(4 * pi * obs_time)) + 0.1 * matrix(rnorm(20), 10, 2)  # each col is a variable
auto_select_kernel_params("gaussian", Y)
#> [[1]]
#> [[1]]$bandwidth
#> [1] 0.7237973
#> 
#> 
#> [[2]]
#> [[2]]$bandwidth
#> [1] 0.9341025
#> 
#>