maximization

LP: postive reduced costs corresponding to positive variables?

谁说我不能喝 提交于 2021-02-08 06:16:38
问题 I have the next LP problem Maximize 1000 x1 + 500 x2 - 500 x5 - 250 x6 Subject To c1: x1 + x2 - x3 - x4 = 0 c2: - x3 + x5 = 0 c3: - x4 + x6 = 0 With these Bounds 0 <= x1 <= 10 0 <= x2 <= 15 0 <= x5 <= 15 0 <= x6 <= 5 By solving this problem with Cplex dual algorithm I get an optimal solution of 6250. But checking the reduced costs of the variables I get the next results Variable value reduced cost 1 10.0 500.0 1 0.0 -0.0 2 5.0 -0.0 3 5.0 -0.0 4 5.0 -0.0 5 5.0 250.0 Is it possible to have a

LP: postive reduced costs corresponding to positive variables?

心不动则不痛 提交于 2021-02-08 06:16:26
问题 I have the next LP problem Maximize 1000 x1 + 500 x2 - 500 x5 - 250 x6 Subject To c1: x1 + x2 - x3 - x4 = 0 c2: - x3 + x5 = 0 c3: - x4 + x6 = 0 With these Bounds 0 <= x1 <= 10 0 <= x2 <= 15 0 <= x5 <= 15 0 <= x6 <= 5 By solving this problem with Cplex dual algorithm I get an optimal solution of 6250. But checking the reduced costs of the variables I get the next results Variable value reduced cost 1 10.0 500.0 1 0.0 -0.0 2 5.0 -0.0 3 5.0 -0.0 4 5.0 -0.0 5 5.0 250.0 Is it possible to have a

How to find the maximum value of a function changing one constant value in R?

 ̄綄美尐妖づ 提交于 2019-12-24 21:42:26
问题 I have the following linearized plot: a and b are vectors with data, c is a constant. The task is find a value of c that maximizes R^2 for a linear regression a <- c(56.60, 37.56, 15.80, 27.65, 9.20, 5.05, 3.54) b <- c(23.18, 13.49, 10.45, 7.24, 5.44, 4.19, 3.38) c <- 1 x <- log(a) y <- log((c*(a/b))-1) rsq <- function(x, y) summary(lm(y~x))$r.squared rsq(x, y) optimise(rsq, maximum = TRUE) 回答1: This works: a <- c(56.60, 37.56, 15.80, 27.65, 9.20, 5.05, 3.54) b <- c(23.18, 13.49, 10.45, 7.24,

Python/Scipy: Find “bounded” min/max of a matrix

给你一囗甜甜゛ 提交于 2019-12-23 12:14:35
问题 I think it is easiest to specify my problem, the generalized case is difficult to explain. Say I have a matrix a with dimensions NxMxT, where one can think about T as a time-dimension (to make the question easier). Let (n,m) be the indices through NxM. I might call (n,m) the state-space identifier. Then I need to find the python/scipy equivalent of for each (n,m): find a*(n,m) = min(a(n,m,:) s.t. a*(n,m) > a(n,m,T) That is, find the smallest state-space value that is still higher than the

Why does optimx in R not give the correct solution to this simple nonparametric likelihood maximization?

只谈情不闲聊 提交于 2019-12-09 15:29:05
问题 Is optimx() providing incorrect solution or am I missing a simple point? Thank you! I am trying to maximize a very simple likelihood. This is a non-parametric likelihood in the sense that the distribution of F is not specified parametrically. Rather, for each observed xi , f(xi)=pi and thus log(Likelihood)=Sum(log(f(xi)))=Sum(log(pi)) . The function I am trying to maximize is: sum(log(pi))+lamda(sum(pi-1)) where sum(pi)=1 (i.e. this is a constrained maximization problem which can be solved

constrained optimization in R setting up constraints

帅比萌擦擦* 提交于 2019-12-08 01:37:00
问题 I have been trying to solve a constrained optimization problem in R using constrOptim() (my first time) but am struggling to set up the constraints for my problem. The problem is pretty straight forward and i can set up the function ok but am a bit at a loss about passing the constraints in. e.g. problem i've defined is (am going to start with N fixed at 1000 say so i just want to solve for X ultimately i'd like to choose both N and X that max profit): so i can set up the function as: fun <-