cvfold: Do cross validation to decide the number of basis function to...

cvfoldR Documentation

Do cross validation to decide the number of basis function to use in smoothing.

Description

Do cross validation to decide the number of basis function to use in smoothing.

Usage

cvfold(cross, pheno.cols, basisset, fold = 10, random = TRUE)

Arguments

cross

An object of class "cross". See the read.cross for details.

pheno.cols

Columns in the phenotype matrix to be used as the phenotype.

basisset

The set of basis numbers to evaluate.

fold

The number of folder in cross validation.

random

randomly divide folder on times if TRUE and select folders equily spaced time points if FALSE.

Value

It gives a vector of sum of squared erros for each basis set.

Author(s)

Il-Youp Kwak, <email: ikwak2@stat.wisc.edu>

See Also

calcfunpca

Examples

data(exd)
exd <- calc.genoprob(exd, step=2)
cvout <- cvfold(exd, basisset = 4:7, fold = 10)
cvout # basis number 5 have the smallest sse. So we take nbasis = 5.
Y <- calcfunpca(exd, criteria=0.9, nbasis = 5)$Y
out1 <- scanoneM(exd, Y, method = "hk")

ikwak2/funqtl documentation built on April 20, 2022, 3:58 a.m.