hglm_fit {holiglm}R Documentation

Fitting Holistic Generalized Linear Models

Description

Fit a generalized linear model under constraints.

Usage

hglm_fit(
  model,
  constraints = NULL,
  big_m,
  solver = "auto",
  control = list(),
  dry_run = FALSE,
  object_size = c("normal", "big")
)

Arguments

model

a 'HGLM' model (object of class "hglm_model").

constraints

a list of 'HGLM' constraints stored in a list of class "lohglmc".

big_m

an upper bound for the coefficients, needed for the big-M constraint. Required to inherit from "hglmc". Currently constraints created by group_sparsity(), group_inout(), include() and group_equal() use the big-M set here.

solver

a character string giving the name of the solver to be used for the estimation.

control

a list of control parameters passed to ROI_solve.

dry_run

a logical if TRUE the model is not fit but only constructed.

object_size

a character string giving the object size, allowed values are "normal" and "big". If "big" is choosen, also the ROI solution and the "hglm_model" object are returned.

Value

an object of class "hglm.fit" inheriting from "glm".

Examples

dat <- rhglm(100, c(1, 2, -3, 4, 5, -6))
x <- model.matrix(y ~ ., data = dat)
model <- hglm_model(x, y = dat[["y"]])
fit <- hglm_fit(model, constraints = k_max(3))

[Package holiglm version 1.0.0 Index]