This function fits penalized gamma GLMs

hdgamma(
  x,
  y,
  weights = rep(1, NROW(x)),
  offset = NULL,
  penalty_factor = NULL,
  nlambda = 100L,
  lambda_min_ratio = ifelse(n < p, 0.05, 0.005),
  lambda = NULL,
  tau = 0,
  intercept = TRUE,
  strongrule = TRUE,
  maxit_irls = 50,
  tol_irls = 1e-05,
  maxit_mm = 500,
  tol_mm = 1e-05
)

Arguments

x

an n x p matrix of covariates for the zero part data, where each row is an observation and each column is a predictor

y

a length n vector of responses taking strictly positive values.

weights

a length n vector of observation weights

offset

a length n vector of offset terms

penalty_factor

a length p vector of penalty adjustment factors corresponding to each covariate. A value of 0 in the jth location indicates no penalization on the jth variable, and any positive value will indicate a multiplicative factor on top of the common penalization amount. The default value is 1 for all variables

nlambda

the number of lambda values. The default is 100.

lambda_min_ratio

Smallest value for lambda, as a fraction of lambda.max, the data-derived largest lambda value The default depends on the sample size relative to the number of variables.

lambda

a user supplied sequence of penalization tuning parameters. By default, the program automatically chooses a sequence of lambda values based on nlambda and lambda_min_ratio

tau

a scalar numeric value between 0 and 1 (included) which is a mixing parameter for sparse group lasso penalty. 0 indicates group lasso and 1 indicates lasso, values in between reflect different emphasis on group and lasso penalties

intercept

whether or not to include an intercept. Default is TRUE.

strongrule

should a strong rule be used?

maxit_irls

maximum number of IRLS iterations

tol_irls

convergence tolerance for IRLS iterations

maxit_mm

maximum number of MM iterations. Note that for algorithm = "irls", MM is used within each IRLS iteration, so maxit_mm applies to the convergence of the inner iterations in this case.

tol_mm

convergence tolerance for MM iterations. Note that for algorithm = "irls", MM is used within each IRLS iteration, so tol_mm applies to the convergence of the inner iterations in this case.

Examples