cvtype: Generating test dataset index for cross-validation

Description Usage Arguments Details Value References Examples

Description

This function generates test dataset index for cross-validation.

Usage

1
cvtype(n, cv.bsize=1, cv.kfold, cv.random=FALSE)

Arguments

n

the number of observation

cv.bsize

block size of cross-validation

cv.kfold

the number of fold of cross-validation

cv.random

whether or not random cross-validation scheme should be used. Set cv.random=TRUE for random cross-validation scheme

Details

This function provides index of test dataset according to various cross-validation scheme. One may construct K test datasets in a way that each testset consists of blocks of b consecutive data. Set cv.bsize = b for this. To select each fold at random, set cv.random = TRUE. See Kim et al. (2012) for detalis.

Value

matrix of which row is test dataset index for cross-validation

References

Kim, D., Kim, K.-O. and Oh, H.-S. (2012) Extending the Scope of Empirical Mode Decomposition using Smoothing. EURASIP Journal on Advances in Signal Processing, 2012:168, doi: 10.1186/1687-6180-2012-168.

Examples

1
2
3
4
# Traditional 4-fold cross-validation for 100 observations
cvtype(n=100, cv.bsize=1, cv.kfold=4, cv.random=FALSE)
# Random 4-fold cross-validation with block size 2 for 100 observations
cvtype(n=100, cv.bsize=2, cv.kfold=4, cv.random=TRUE)

EMD documentation built on Jan. 4, 2022, 1:08 a.m.

Related to cvtype in EMD...