lme1en: lme1en

Description Usage Arguments Details Value Examples

View source: R/lme1en.R

Description

Fitting Elastic Net with random intercept

Usage

1
2
3
lme1en(y, X, batch, lambda = 1, alpha = 0.5, rho = 0, beta = NULL,
  glmnetPenalty = TRUE, glmnetWarmup = TRUE, maxit = 10000,
  toler = 0.001, verbose = FALSE)

Arguments

y

response vector. Should be standardized before input (use scale).

X

Design matrix belonging to fixed effects coefficients (beta). Should be standardized before input (use scale).

batch

factor with batch effect names (vector for each observations)

lambda

numeric, penalty levels for fixed effects betas

alpha

numeric, penalty levels for fixed effects betas (balancing LASSO/RIDGE erros)

rho

proportion of variation explained by batch effect

beta

numeric, initial values of the beta coefficients (using glmnet or marginal estimates if not provided)

glmnetPenalty

boolean, whether to use the original peanalty (FALSE) or the glmnet penalty (TRUE)

glmnetWarmup

boolean, whether to use glmnet beta-estimates as warmup (if not marginals are used)

maxit

maximum number of iterations (i.e. forloops) in the coordinate decent algorithm

toler

tolerance level of beta changes for each iterations (similar to 'thresh' in glmnet)

verbose

boolean, show progress Default: FALSE

Details

The model is fitted using the coordinate decent algorithm (exact solutions) The extended model includes the rho parameter (proportion of total variation) as argument. Calls a algorithm (iterate) in C which uses exact solutions of marginal beta's based on formula x = sgn(c/a)(|c/a| - b/a)_+, where ax + b*sgn(x) = c The function assume that the response y and design matrix X are centralized (no intercept returned from function)

Value

fitted beta values

Examples

1
2
3
4
5
## Not run:  
dat = genData(seed=1)
bhat = lme1en(y=dat$y,X=dat$X,batch=dat$batch, rho=0.3,lambda=0.1,alpha=0.5,verbose=TRUE)

## End(Not run)

oyvble/lme1en documentation built on April 30, 2020, 2:41 p.m.