You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose that I'd like to fit a constrained Poisson GLM using CVXR, much like the logistic regression example in the documentation.
The program does not seem to optimize the function using either maximum likelihood formulation
## MWE
library(CVXR)
y <- rpois(n=100, lambda=50)
X <- matrix(rnorm(100), ncol=1)
betaHat <- Variable(1)
obj <- sum(y* log(exp(X %*% betaHat)) - exp(X %*% betaHat))
prob <- Problem(Maximize(obj))
result <- CVXR::solve(prob)
or a Poisson loss formulation
obj <- mean(exp(X %*% betaHat) - y * log(exp(X %*% betaHat)))
prob <- Problem(Minimize(obj))
result <- CVXR::solve(prob)
returning the error Error in construct_intermediate_chain(object, candidate_solvers, gp = gp) : Problem does not follow DCP rules. However, the problem does follow DGP rules. Consider calling this function with gp = TRUE. Setting gp=TRUE gives an opposite error.
Am I overlooking something?
The text was updated successfully, but these errors were encountered:
Hi,
Suppose that I'd like to fit a constrained Poisson GLM using
CVXR
, much like the logistic regression example in the documentation.The program does not seem to optimize the function using either maximum likelihood formulation
or a Poisson loss formulation
returning the error
Error in construct_intermediate_chain(object, candidate_solvers, gp = gp) : Problem does not follow DCP rules. However, the problem does follow DGP rules. Consider calling this function with gp = TRUE
. Settinggp=TRUE
gives an opposite error.Am I overlooking something?
The text was updated successfully, but these errors were encountered: