This function extracts the appropriate trend, and applies its implied kernel
using either the pure R implementation or the Rcpp version.
When mode = "compare", the function checks whether the
two implementations produce identical output.
apply_kernel(kernel_pars, emc, subject = 1, input_pars = NULL, trend_n = 1)Returns a kernel matrix produced by the corresponding implementation.
A named vector of kernel parameters on the natural scale.
Use NULL for kernels that do not require parameters.
An emc.
Subject index for which to apply the kernel. Defaults to 1.
Optional parameter matrix containing externally supplied parameter values (e.g., trend parameters). Only needed for custom kernels.
Integer specifying which trend to apply when multiple trends
exist in the model. Defaults to 1. A warning is issued if the model
contains more than one trend.
Applies the trend-specific kernel associated with an emc model to the
a subject's data and returns the resulting kernel matrix.