spring: Select Primary Relationships IN the General linear model.

Description Usage Arguments Value See Also

Description

Adjust a multivariate regression with structuring, sparse penalty.

Usage

1
2
3
4
5
6
7
spring(x, y, lambda1 = NULL, lambda2 = c(1, 0.1, 0.01, 0.001),
  struct = sparseMatrix(i = 1:p, j = 1:p, x = rep(1, p)), cov = NULL,
  intercept = TRUE, normalize = FALSE, threshold = 0.001,
  max.iter = 100, verbose = ifelse(length(lambda2) > 1, 1, 2),
  min.ratio = 0.01, nlambda1 = ifelse(is.null(lambda1), ifelse(is.null(cov),
  10, 50), length(lambda1)), comp.df = TRUE, mc.cores = min(length(lambda2),
  detectCores()))

Arguments

x

matrix of features. Do NOT include intercept.

y

matrix of responses.

lambda1

sequence of decreasing l1-penalty levels. If NULL (the default), a vector is generated with nlambda1 entries, starting from a guessed level lambda1.max where only the intercept is included, then shrunken to min.ratio*lambda1.max.

lambda2

real scalar; tunes the l2 structuring penalty in the Elastic-net. Default is 0.05.

struct

matrix structuring the coefficients, possibly sparsely encoded. If NULL (the default), the identity matrix is used. See details below.

cov

the matrix of variance-covariance between the reponses y. If NULL (the default), will be inferred.

intercept

logical; indicates if a vector of intercepts should be included in the model. Default is TRUE.

normalize

logical; indicates if predictor variables should be normalized to have unit L2 norm before fitting. Default is TRUE.

threshold

a threshold for convergence for each lambda1. The algorithm stops the alternate scheme when the norm of two successive values of the parameters the is below this threshold. Default is 1e-3.

max.iter

integer; the maximal number of iteration (i.e. number of alternated optimization between each parameter) used to solve the problem for a given value of lambda1. Default is 100

verbose

integer; activate verbose mode from '0' (nothing) to '2' (detailed output).

min.ratio

minimal value of l1-part of the penalty that will be tried, as a fraction of the maximal lambda1 value. A too small value might lead to unstability at the end of the solution path corresponding to small lambda1 combined with lambda2=0. The default value tries to avoid this, adapting to the 'n<p' context. Ignored if lambda1 is provided.

nlambda1

integer that indicates the number of values to put in the lambda1 vector. Ignored if lambda1 is provided.

comp.df

<...>

mc.cores

if lambda2 is a vector, spring is run in parallel: the default is to use as many core as there are entries in lambda2, limited by the physical nulber of cores itself.

Value

an object with class spring, see the documentation page spring for details.

See Also

See also spring and cv.spring.


jchiquet/spring documentation built on May 18, 2019, 10:22 p.m.