View source: R/tune_vem_by_gcv.R
| tune_vem_by_gcv | R Documentation |
Fits vem_smooth across a grid of candidate basis sizes
K_grid and selects the best K using GCV scores from
gcv_vem. Called internally by vem_fit when
a vector of K values is supplied; not typically called directly.
Two selection modes are supported: "mean" selects the single K
minimizing the mean GCV across all curves; "per_curve" selects the
K that minimizes the GCV criterion for each individual curve, producing a composite fit.
tune_vem_by_gcv(
y,
Xt,
K_grid,
build_B,
initial_values_fn,
threshold = 0.5,
mode = c("mean", "per_curve"),
...
)
y |
List of curves. |
Xt |
Numeric vector of time points. |
K_grid |
Integer vector of candidate |
build_B |
Function with signature |
initial_values_fn |
Function with signature |
threshold |
Posterior inclusion probability (PIP) threshold passed to |
mode |
Character. |
... |
Additional arguments passed to |
A list with:
fitsNamed list of fitted vem_smooth objects, one per
candidate K.
gcv_matrixNumeric matrix (m \times length(K_grid))
of per-curve GCV scores.
best_K_meanInteger. Best K by mean GCV.
best_K_per_curveInteger vector of length m. Best
K for each curve.
da Cruz, A. C., de Souza, C. P. E., & Sousa, P. H. T. O. (2024). Fast Bayesian basis selection for functional data representation with correlated errors. arXiv:2405.20758. https://arxiv.org/abs/2405.20758
vem_fit, gcv_vem
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.