cv_glmaag: Cross validation for glmaag

Description Usage Arguments Value Examples

Description

Do k-fold cross-validation for glmaag

Usage

1
2
3
4
5
cv_glmaag(y, x, L, nfolds = 5, cvwhich, foldseed, stratify = T,
  gam = 1, tune = F, est = T, lam1, lam2, dfmax, w0, adaptl1 = T,
  adaptl2 = T, pind, intercept = T, standardize = T,
  maxiter = 10000, cri = 0.001, fam = "Gaussian", measdev = T,
  type1se = T, parallel = F)

Arguments

y

outcome

x

predictors matrix

L

Laplacian matrix for the first network

nfolds

number of folds used in cross validation, default to be five

cvwhich

fold assignment, start from zero, if missing do random cross validation

foldseed

the random seed for cross validation design

stratify

whether to do stratified cross validation for Logistic or Cox model, default to be TRUE

gam

The power of weights of L1 penalty, default to be ones

tune

whether to tune the input network with estimated network or identity matrix, ignored if no input network

est

when there is no input network whether to use estimated network or identiy matrix (elastic net) or mixed the network with estimated network or identity matrix, default to be estimated network

lam1

The tuning parameters for L1 penalty. If not defined, searched by default

lam2

The tuning parameters for quadratic penalty. If not defined, searched by default

dfmax

maximum number of parameters allowed in the model, default to be p/2

w0

Weights for L1 penalty. If not defined, estimated via quadratic penalyzed regression

adaptl1

whether to adapt the L1 penalty, default to be TRUE

adaptl2

whether to adapt the sign for quadratic penalty, default to be TRUE

pind

indicator vector whether to put L1 penalty on the feature, 1 means penalyzed while 0 means not penalyzed, default to be all ones (all penalyzed)

intercept

whether to include intercept. Ignore for Cox regression

standardize

whether to standardize predictors

maxiter

maximum number of iterations, default to be 500

cri

stoppint criterion, default to be 0.001

fam

family for the outcome, can be "Gaussian", "Logistic", and "Cox"

measdev

Whether to use deviance to tune, default to be deviance. If not, use mean absolue error, area under ROC curve, or concordance index for Gaussian, Logistic, and Cox

type1se

whether to use one standard error or maximum rule, default to be one standard error rule

parallel

whether to do parallel computing at each fold, need to set up parallel first, default to be FALSE

Value

input

input predictor matrix

inputweight

estimated weights if mixing network

lambda1

lambda1 path that has been searched

lambda1

lambda1 path that has been searched

lambda1_max

selected lambda1 based on maximum rule

lambda2_max

selected lambda2 based on maximum rule

lambda1_1se

selected lambda1 based on one standard error rule

lambda2_1se

selected lambda2 based on one standard error rule

cvm

the mean cross validation accuracy

cv1se

the standard error of cross validation accuracy

cvn

the mean number of parameter estimated among folds

n_max

number of selected features based on maximum rule

n_1se

number of selected features based on one standard error rule

intercept_max

estimated intercept based on maximum rule

intercept_1se

estimated intercept based on one standard error rule

coef_max

estimated coefficients based on maximum rule

coef_1se

estimated coefficients based on one standard error rule

fam

family of outcome

measure

measure in cross validation

Examples

1
2
3
4
5
6
data(sampledata)
data(L0)
y <- sampledata$Y_Gau
x <- sampledata[, -(1:3)]
cvwhich <- sample(rep(0:4, length.out = length(y)))
mod <- cv_glmaag(y, x, L0, cvwhich = cvwhich)

glmaag documentation built on May 10, 2019, 9:04 a.m.