Skip to content

Commit

Permalink
DS-3136 Restore call to sum instead of Sum
Browse files Browse the repository at this point in the history
Object of class Multiply from the CVXR package is
a deeply nested listed and not suitable for use in
Sum
  • Loading branch information
jrwishart committed Jan 21, 2021
1 parent 0804a23 commit b9165dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/calibrate.R
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ computeCalibrate <- function(adjustment.variables, margins, input.weight, raking
n <- NROW(X)
g <- Variable(n)
constraints = list(t(A) %*% g == margins)
Phi_R = Minimize(Sum(input.weight * (-entr(g) - g + 1), remove.missing = FALSE))
Phi_R = Minimize(sum(input.weight * (-entr(g) - g + 1)))
p = Problem(Phi_R, constraints)
res = solve(p)
as.numeric(input.weight * res$getValue(g))
Expand Down

0 comments on commit b9165dc

Please sign in to comment.