Skip to contents

Return the numeric penalty associated with an information criterion, for inspection or use as the lambda argument of L0glm.fit or L0nnpois.

Usage

preset.lambda(IC = "gic", p, n, gamma_ebic = max(0, 1 - log(n)/(2 * log(p))))

Arguments

IC

Case-insensitive criterion name: "gic" (default), "aic", "bic", "ebic" or "mbic".

p

Number of original selectable predictors, excluding intercepts and other compulsory terms, before screening or starting-value exclusions. Use p = 1 when there are no selectable predictors.

n

Sample size used by the information criterion. For ordinary GLMs this is the number of observations. See model_criteria for the sample-size conventions for special families.

gamma_ebic

Coefficient of the multiplicity term for IC = "ebic". The default is \(\max\{0,1-\log(n)/(2\log(p))\}\). It is unused for the other criteria.

Value

A numeric scalar containing the penalty per parameter.

Details

The returned value is \(\lambda\) on the \(-2\ell + \lambda d\) scale, where \(\ell\) is the fitted log likelihood and \(d\) is the parameter count. All logarithms are natural. AIC gives 2, BIC gives \(\log(n)\), and GIC gives \(\log(p)\log\log(n)\). Formulas, parameter-count conventions and references for all supported criteria are given in information_criteria.

With the default gamma_ebic, passing the result as a numeric lambda uses the same preset as passing its criterion name. Dispersion adjustment and the adaptive-ridge factor of \(1/4\) are applied inside the fitters. A custom gamma_ebic can be supplied here and the resulting penalty passed to a fitter.

Examples

preset.lambda("gic", p = 10000, n = 10000)
vapply(c("aic", "bic", "gic", "ebic", "mbic"), preset.lambda,
       numeric(1), p = 10000, n = 10000)
preset.lambda("ebic", p = 10000, n = 1000, gamma_ebic = 1)