cv_choose {gspcr}R Documentation

Cross-validation choice

Description

Extracting the CV choices of SPCR parameters.

Usage

cv_choose(scor, scor_lwr, scor_upr, K, fit_measure)

Arguments

scor

npcs \times nthrs matrix of K-fold CV scores

scor_lwr

npcs \times nthrs matrix of score lower bounds

scor_upr

npcs \times nthrs matrix of score upper bounds

K

numeric vector of length 1 storing the number of folds for the K-fold cross-validation procedure

fit_measure

character vector of length 1 indicating the type of fit measure to be used in the to cross-validation procedure

Details

Given a matrix of npcs \times nthrs, returns the best choice based on the type of fit measure (best overall and 1se rule versions.) This function returns as solutions:

Value

A list of two numeric vectors:

Author(s)

Edoardo Costantini, 2023

Examples

# Score matrices
scor <- matrix(c(1, 2, 3, 4, 5, 6), nrow = 3, ncol = 2)
scor_lwr <- matrix(c(1, 2, 3, 4, 5, 6) - 1.5, nrow = 3, ncol = 2)
scor_upr <- matrix(c(1, 2, 3, 4, 5, 6) + 1.5, nrow = 3, ncol = 2)

# Number of folds
K <- 10

# Type of fit_measure
fit_measure <- "F"

# Use the function
cv_choose(scor, scor_lwr, scor_upr, K, fit_measure)


[Package gspcr version 0.9.5 Index]