buildLambdas: buildLambdas

View source: R/computeLambda.R

buildLambdasR Documentation

buildLambdas

Description

generate lambda vector based on dataset given

Usage

buildLambdas(fix, rnd, data, nlambdas = 100,
  lambda.min.ratio = ifelse(nobs < nvars, 0.01, 1e-04))

Arguments

fix

A two-sided linear formula object describing the fixed-effects part of the model, with the response on the left of a ~ operator and the terms, separated by + operators, on the right. For categorical covariables use as.factor(.) in the formula. Note, that the corresponding dummies are treated as a group and are updated blockwise

rnd

A two-sided linear formula object describing the random-effects part of the model, with the grouping factor on the left of a ~ operator and the random terms, separated by + operators, on the right; alternatively, the random effects design matrix can be given directly (with suitable column names). If set to NULL, no random effects are included.

data

The data frame containing the variables named in formula.

nlambdas

the number of lambdas values, default value is 100 if lambdas is not user-supplied

lambda.min.ratio

Smallest value for lambda, as a fraction of lambda.max, the (data derived) entry value (i.e. the smallest value for which all coefficients are zero). The default depends on the sample size nobs relative to the number of variables nvars. If nobs > nvars, the default is 0.0001, close to zero. If nobs < nvars, the default is 0.01.

Value

returns a vector of lambda

Author(s)

Pirapong Jitngamplang, Jared Lander


thepira/cv.glmmLasso documentation built on Dec. 11, 2022, 11:20 p.m.