RMRCE_cv: RMRCE_cv

Description Usage Arguments Details Value Author(s) Examples

Description

Cross validation for choosing RMRCE tuning parameters

Usage

1
RMRCE_cv(X, Y, lambdavec, alphavec)

Arguments

X

A numeric matrix of explanatory variables.

Y

A numeric vector of response.

lambda

A numeric vector of tuning parameter lambda for which the testing error is to be computed.

alpha

A numeric vector of tuning parameter alpha for which the testing error is to be computed.

Details

This function performs a five-fold cross validation to choose the optimal tuning parameters lambda and alpha which yield the smallest testing error.

Value

A data.frame which has three columns: lambda, alpha and corresponding testing error. Lambda and alpha that yield the smallest testing error are selected as the optimal tuning parameters.

Author(s)

Fang Han, Hongkai Ji, Zhicheng Ji, Honglang Wang <zji4@jhu.edu>

Examples

1
2
3
4
5
6
Y <- rnorm(100)
X <- cbind(Y+rnorm(100,sd=0.1),-0.5*Y+rnorm(100,sd=0.1),rnorm(100,sd=0.1))
cv <- RMRCE_cv(X,Y,c(0.001,0.01),c(1,5))
optlambda <- cv[which.min(cv[,3]),1]
optalpha <- cv[which.min(cv[,3]),2]
fit <- RMRCE(X,Y,optlambda,optalpha)

zji90/RMRCE documentation built on May 31, 2019, 8:32 a.m.