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 |
constraints |
a list of 'HGLM' constraints stored in a list of class |
big_m |
an upper bound for the coefficients, needed for the big-M constraint.
Required to inherit from |
solver |
a character string giving the name of the solver to be used for the estimation. |
control |
a list of control parameters passed to |
dry_run |
a logical if |
object_size |
a character string giving the object size, allowed values
are |
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))