cv_average {gspcr} | R Documentation |
Average fit measures computed in the K-fold cross-validation procedure
Description
Function to average results from an array of K-fold CV fit measures.
Usage
cv_average(cv_array, fit_measure)
Arguments
cv_array |
|
fit_measure |
character vector of length 1 indicating the type of fit measure to be used in the to cross-validation procedure |
Details
The input of this function is an array of Q \times nthrs \times K
, where Q
is the number of principal components, nthrs
is the number of thresholds, and K
is the number of folds.
Value
list of three Q \times nthrs
matrices:
-
scor
: contains the average CV scores across the K folds -
scor_upr
: contains the average CV scores across the K folds + 1 standard deviation -
scor_lwr
: contains the average CV scores across the K folds - 1 standard deviation
Author(s)
Edoardo Costantini, 2023
Examples
# Example inputs
cv_array = array(abs(rnorm(10 * 3 * 2)), dim = c(10, 3, 2))
fit_measure = "F"
# Use the function
cv_average(cv_array, fit_measure)