R: Calculates ranges of the unknowns of a linear inverse problem

xranges {limSolve} | R Documentation

## Calculates ranges of the unknowns of a linear inverse problem

### Description

Given the linear constraints

Ex=f

Gx>=h

finds the minimum and maximum values of all elements of vector x

This is done by successively minimising and maximising each `x`, using linear programming.

### Usage

    xranges(E = NULL, F = NULL, G = NULL, H = NULL,
            ispos = FALSE, tol = 1e-8, central = FALSE, full=FALSE)

### Arguments

`E` | numeric matrix containing the coefficients of the equalities 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.
`ispos` | if `TRUE`, it is imposed that unknowns are positive quantities.
`tol` | tolerance for equality and inequality constraints.
`central` | if TRUE, the mean value of all range solutions is also outputted.
`full` | if `TRUE`, all range solutions are also outputted.

### Details

The ranges are estimated by successively minimising and maximising each unknown, and using linear programming (based on function `lp` from R-package `lpSolve`.

By default linear programming assumes that all unknowns are positive. If all unknowns are indeed to be positive, then it will generally be faster to set `ispos` equal to TRUE If `ispos` is `FALSE`, then a system double the size of the original system must be solved.

`xranges` outputs only the minimum and maximum value of each flow unless:

`full` is `TRUE`. In this case, all the results of the successive minimisation and maximisation will be outputted, i.e. for each linear programming application, not just the value of the unknown being optimised but also the corresponding values of the other unknowns will be outputted.

If `central` is `TRUE`, then the mean of all the results of the linear programming will be outputted. This may be a good starting value for `xsample`

Note: the columns corresponding to the `central` value and the `full` results are valid solutions of the equations Ex=F and Gx>=H. This is not the case for the first two columns (with the minimal and maximal values).

### Value

a matrix with at least two columns:

column 1 and 2: the minimum and maximum value of each `x`

if `central` is TRUE: column 3 = the central value

if `full` is TRUE: next columns contain all valid range solutions

### Author(s)

Karline Soetaert <karline.soetaert@nioz.nl>

### References

Michel Berkelaar and others (2010). lpSolve: Interface to Lp_solve v. 5.5 to solve linear/integer programs. R package version 5.6.5. http://CRAN.R-project.org/package=lpSolve

### See Also

`Minkdiet`, for a description of the Mink diet example.

`varranges`, for range estimation of variables,

`xsample`, to randomly sample the lsei problem

`lp`: linear programming from package lpSolve

### Examples

    # Estimate the ranges in the Diet Composition of Mink
    E <- rbind(Minkdiet$Prey, rep(1, 7))
    F <- c(Minkdiet$Mink, 1)
    (DC <- xranges(E, F, ispos = TRUE))

    # The same, but explicitly imposing positivity
    (DC <- xranges(E, F, G = diag(7), H = rep(0, 7)))

[Package limSolve version 1.5.5.3 Index]