as.OP.hglm_model function

Convert to OP

Convert to OP

Convert an object of class "hglm_model" into a ROI optimization problem (OP).

## S3 method for class 'hglm_model' as.OP(x)

Arguments

  • x: an object inheriting from "hglm_model".

Returns

A ROI object of class "OP".

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.

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)
  • Maintainer: Benjamin Schwendinger
  • License: GPL-3
  • Last published: 2024-12-20

Useful links