as.OP.hglm_model {holiglm} | R Documentation |
Convert to OP
Description
Convert an object of class "hglm_model"
into a ROI optimization problem (OP
).
Usage
## S3 method for class 'hglm_model'
as.OP(x)
Arguments
x |
an object inheriting from |
Details
This function is mainly for internal use and advanced users which want of
alter the model object or the underlying optimization problem.
This function converts the model object created by hglm_model
into a conic optimization problem solveable via ROI_solve
.
Value
A ROI object of class "OP"
.
Examples
dat <- rhglm(100, c(1, 2, -3, 4, 5, -6))
# Use hglm with option dry_run
model <- hglm(y ~ ., data = dat, dry_run = TRUE)
op <- as.OP(model)
# User hglm_model
x <- model.matrix(y ~ ., data = dat)
model <- hglm_model(x, dat[["y"]])
op <- as.OP(model)
[Package holiglm version 1.0.0 Index]