Last data update: 2014.03.03

R: cross validation for EM fused-lasso
EMcvfusedlassoR Documentation

cross validation for EM fused-lasso

Description

cross validation function for EMfusedlasso.

Usage

EMcvfusedlasso(X, y, lambda1, lambda2, nbFolds = 10, maxSteps = 1000,
  burn = 50, intercept = TRUE, model = c("linear", "logistic"),
  eps = 1e-05, eps0 = 1e-08, epsCG = 1e-08)

Arguments

X

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

y

a vector of length n with the response.

lambda1

Values of lambda1 at which prediction error should be computed. Can be a single value.

lambda2

Values of lambda2 at which prediction error should be computed. Can be a single value.

nbFolds

the number of folds for the cross-validation.

maxSteps

Maximal number of steps for EM algorithm.

burn

Number of steps for the burn period.

intercept

If TRUE, there is an intercept in the model.

model

"linear" or "logistic".

eps

Tolerance of the algorithm.

eps0

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

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 cv.

minCv

Minimal cv criterion.

lambda1

Values of lambda1 at which prediction error should be computed.

lambda2

Values of lambda2 at which prediction error should be computed.

lambda.optimal

Value of (lambda1,lambda2) 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=EMcvfusedlasso(dataset$data,dataset$response,3:1,3: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/EMcvfusedlasso.Rd_%03d_medium.png", width=480, height=480)
> ### Name: EMcvfusedlasso
> ### Title: cross validation for EM fused-lasso
> ### Aliases: EMcvfusedlasso
> 
> ### ** Examples
> 
> dataset=simul(50,100,0.4,1,10,matrix(c(0.1,0.8,0.02,0.02),nrow=2))
> result=EMcvfusedlasso(dataset$data,dataset$response,3:1,3:1,5,intercept=FALSE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>