cv_average | R Documentation |
Function to average results from an array of K-fold CV fit measures.
cv_average(cv_array, fit_measure)
cv_array |
|
fit_measure |
character vector of length 1 indicating the type of fit measure to be used in the to cross-validation procedure |
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.
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
Edoardo Costantini, 2023
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.