Skip to content

Commit d449839

Browse files
author
Matt Secrest
committed
cvxr
1 parent a9a1754 commit d449839

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,4 @@ importFrom(stats,rbinom)
6262
importFrom(stats,rmultinom)
6363
importFrom(stats,var)
6464
importFrom(utils,data)
65+
importMethodsFrom(CVXR,solve)

R/SCM.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ subject_SC <- function(subject, X10, X00, long_term_col_name, lambda) {
222222
obj <- loss + penal(w = w, x1 = x1, X0 = X0, lambda = lambda)
223223
constr <- list(sum(w) == 1, w >= 0)
224224
prob <- Problem(Minimize(obj), constr)
225-
result <- CVXR::solve(prob, solver = "ECOS")
225+
result <- solve(prob, solver = "ECOS")
226226
# estimated weight for this subject
227227
wt.est <- result$getValue(w)
228228
# sc estimate for all time points for this subject
@@ -268,7 +268,7 @@ lambdacv <- function(ec,
268268
obj <- loss + penal(w = w, x1 = x1, X0 = X0, lambda = lambda)
269269
constr <- list(sum(w) == 1, w >= 0)
270270
prob <- Problem(Minimize(obj), constr)
271-
result <- CVXR::solve(prob, solver = "ECOS")
271+
result <- solve(prob, solver = "ECOS")
272272
# estimated weight for this subject
273273
wt.est <- result$getValue(w)
274274
# sc estimate for all time points for this subject

R/package.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#' @import tidyr
77
#' @import boot
88
#' @importFrom CVXR Variable Minimize Problem
9+
#' @importMethodsFrom CVXR solve
910
#' @import progress
1011
#' @import future.apply
1112
#' @importFrom methods is new

0 commit comments

Comments
 (0)