cv.hmlasso: Fit a model using a design matrix with cross validation

Description Usage Arguments Value Examples

View source: R/cross_validator.R

Description

Fit a model using a design matrix with cross validation

Usage

1
2
3
4
5
6
7
cv.hmlasso(X, y, nfolds = 10, lambda.min.ratio = 0.01, nlambda = 100,
  lambda = NULL, foldid = NULL, unit = "sample", seed = 0,
  min_eig_th = 1e-06, use = "pairwise.complete.obs",
  impute_method = "mean", direct_prediction = FALSE,
  adjust_by_tr = FALSE, positify = "diag", weight_power = 1,
  mu = 1, eig_tol = 1e-08, eig_maxitr = 1e+08, verbose = FALSE,
  ...)

Arguments

X

matrix of explanatory variables

y

vector of objective variable

nfolds

the number of folds (ignored if foldid is specified)

lambda.min.ratio

ratio of max lambda and min lambda (ignored if lambda is specified)

nlambda

the number of lambda (ignored if lambda is specified)

lambda

lambda sequence

foldid

vector indicating id of fold for each sample

unit

unit for cross validation error: "sample" (default) or "fold"

seed

random seed of cross validation

min_eig_th

minimum eigenvalue

use

method to calculate correlation matrix from missing data (default "pairwise.complete.obs")

impute_method

imputation method for predictions

direct_prediction

either corrected cross validation is used or not

adjust_by_tr

whether mean (or median) of training data for prediction is used or not

positify

method for solving PSD matrix

weight_power

weighting power (default 0 meaning no-weighting)

mu

augmented Lagrangian parameter

eig_tol

tol parameter in eigs_sym function

eig_maxitr

maxitr parameter in eigs_sym

verbose

whether output verbose warnings and messages (default FALSE)

...

parameters of hmlasso function

Value

lasso model

fit

lasso model with hole data

lambda.min

lambda with minimum cross validation error

lambda.min.index

index of lambda.min

lambda.1se

largest lambda such that error is within 1 standard error of the minimum

lambda.1se.index

index of lambda.1se

foldid

fold id

cve

cross validation error

cvse

cross validation standard error

cvup

cross validation error + standard error

cvlo

cross validation error - standard error

pe

prediction error (for family="binomial")

Examples

1
2
3
4
5
6
7
X_incompl <- as.matrix(iris[, 1:3])
X_incompl[1:5,1] <- NA
X_incompl[6:10,2] <- NA
y <- iris[, 4]
cv_fit <- cv.hmlasso(X_incompl, y, nlambda=50, lambda.min.ratio=1e-2)
plot(cv_fit)
plot(cv_fit$fit)

hmlasso documentation built on Aug. 3, 2019, 9:03 a.m.