| xranges {limSolve} | R Documentation |
Given the linear constraints
Ex=f
Gx>=h
finds the minimum and maximum values of all elements of vector x
by successively minimising and maximising each x, using linear programming
Uses lpSolve - see note
xranges(E=NULL, F=NULL, G=NULL, H=NULL)
E |
numeric matrix containing the coefficients of the equaliies Ex=F |
F |
numeric vector containing the right-hand side of the equalities |
G |
numeric matrix containing the coefficients of the inequalities Gx>=H |
H |
numeric vector containing the right-hand side of the inequalities |
a 2-column matrix with the minimum and maximum value of each x
we have experienced that lpSolve sometimes fails (and R stops) if it is frequently repeated, and for small problems.
Karline Soetaert <k.soetaert@nioo.knaw.nl>
varranges,
lp: linear programming from package lpSolve
# Estimate the ranges in the Diet Composition of Mink A <- rbind(Minkdiet$Prey,rep(1,7)) B <- c(Minkdiet$Mink,1) (DC<-xranges(A,B))