cvR_pred: Cross-validation for Degree-of-separability Selection via...

View source: R/cvR.R

cvR_predR Documentation

Cross-validation for Degree-of-separability Selection via Prediction

Description

Examines the prediction performance of R-separable model for the degree of separability R=1,...,maxR via a cross-validated scheme: for every surface in the current hold-out sample, part of the surface (a fixed number of rows and columns given by perc) is predicted based on the remainder, and relative prediction error is calculated. Two random splits of every observation are predicted.

Usage

cvR_pred(X, Folds = 10, maxR = 7, maxiter = 10, perc = NULL)

Arguments

X

data set, array of size N x K1 x K2

Folds

number of folds

maxR

maximum degree-of-separability considered

maxiter

maximum number of iterations for scd_est()

perc

number in (0,1) giving the portion of rows and columns held out for prediction, defaults to 1/2, in that case 3/4 of every held-out surface is predicted based on the remaining 1/4

Value

vector of prediction performances for different values of R

Examples

X <- array(runif(20*3*4),c(20,3,4))
cvscores <- cvR_pred(X,10,5)
min(localMaxima(-cvscores)) # best R is chosen as the smallest local minimum
                            # of the CV objective

TMasak/surfcov documentation built on April 25, 2022, 12:15 a.m.