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

Q \times nthrs \times K array containing fit measures computed for different combinations of the number of components, threshold values, and number of CV-folds.

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:

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)


[Package gspcr version 0.9.5 Index]