lagrange multipliers for a linear programming prob in R -
for lp matlab gives lambdas (lagrange multipliers) output lp problem. can see more here: http://se.mathworks.com/help/optim/ug/linprog.html?refresh=true after have solved lp in r, there (a realtively easy) way lambdas of problem somehow?
in matlab:
f = [-5; -4; -6]; = [1 -1 1 3 2 4 3 2 0]; b = [20; 42; 30]; lb = zeros(3,1); [x,fval,exitflag,output,lambda] = linprog(f,a,b,[],[],lb);
in r:
f = c(-5, -4, -6) = matrix(c(1, -1, 1, 3, 2, 4, 3, 2, 0), nrow=3, byrow=t) b = c(20, 42, 30) const.dir = c("<=", "<=", "<=") solvelp(f,b,a,maximum=f,const.dir, lpsolve=t)
but how labmda values in r in matlab?
Comments
Post a Comment