Last data update: 2014.03.03

R: cross validation for 'EMlasso'
EMcvlassoR Documentation

cross validation for EMlasso

Description

cross validation function for EMlasso.

Usage

EMcvlasso(X, y, lambda = NULL, nbFolds = 10, maxSteps = 1000,
  intercept = TRUE, model = c("linear", "logistic"), burn = 30,
  threshold = 1e-08, eps = 1e-05, epsCG = 1e-08)

Arguments

X

the matrix (of size n*p) of the covariates.

y

a vector of length n with the response.

lambda

Values at which prediction error should be computed.

nbFolds

the number of folds for the cross-validation.

maxSteps

Maximal number of steps for EM algorithm.

intercept

If TRUE, there is an intercept in the model.

model

"linear" or "logistic".

burn

Number of steps for the burn period.

threshold

Zero tolerance. Coefficients under this value are set to zero.

eps

Tolerance of the EM algorithm.

epsCG

Epsilon for the convergence of the conjugate gradient.

Value

A list containing

cv

Mean prediction error for each value of index.

cvError

Standard error of lambda.

minCv

Minimal lambda criterion.

lambda

Values of lambda at which prediction error should be computed.

lambda.optimal

Value of lambda for which the cv criterion is minimal.

Author(s)

Quentin Grimonprez, Serge Iovleff

Examples

dataset=simul(50,100,0.4,1,10,matrix(c(0.1,0.8,0.02,0.02),nrow=2))
result=EMcvlasso(dataset$data,dataset$response,5:1,5,intercept=FALSE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HDPenReg)
Loading required package: rtkore
Loading required package: Rcpp

Attaching package: 'rtkore'

The following object is masked from 'package:Rcpp':

    LdFlags

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HDPenReg/EMcvlasso.Rd_%03d_medium.png", width=480, height=480)
> ### Name: EMcvlasso
> ### Title: cross validation for 'EMlasso'
> ### Aliases: EMcvlasso
> 
> ### ** Examples
> 
> dataset=simul(50,100,0.4,1,10,matrix(c(0.1,0.8,0.02,0.02),nrow=2))
> result=EMcvlasso(dataset$data,dataset$response,5:1,5,intercept=FALSE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>