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.
Arguments
- kernel_pars
A named vector of kernel parameters on the natural scale. Use
NULLfor kernels that do not require parameters.- emc
An
emc.- subject
Subject index for which to apply the kernel. Defaults to
1.- input_pars
Optional parameter matrix containing externally supplied parameter values (e.g., trend parameters). Only needed for custom kernels.
- trend_n
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.- mode
Character string specifying which implementation to use:
"R"Use the pure R implementation.
"Rcpp"Use the Rcpp implementation (default).