Learn R Programming

catalytic (version 0.1.0)

get_glm_lambda: Compute Lambda Based on Discrepancy Method

Description

This function calculates a lambda value based on the selected discrepancy method for a generalized linear model (GLM). The discrepancy method determines the type of error or deviance used in the calculation.

Usage

get_glm_lambda(
  discrepancy_method = c("mean_square_error", "mean_classification_error",
    "logistic_deviance"),
  X,
  coefs
)

Value

Numeric. The computed lambda value based on the selected discrepancy method.

Arguments

discrepancy_method

Character. A string specifying the type of discrepancy method to use. Options are "mean_square_error", "mean_classification_error", or "logistic_deviance". Default is "mean_square_error".

X

Matrix. The design matrix (predictors) for the GLM.

coefs

Numeric vector. The coefficients for the GLM.