ldp | R Documentation |
Solves the following inverse problem:
\min(\sum {x_i}^2)
subject to
Gx>=h
uses least distance programming subroutine ldp (FORTRAN) from Linpack
ldp(G, H, tol = sqrt(.Machine$double.eps), verbose = TRUE,
lower = NULL, upper = NULL)
G |
numeric matrix containing the coefficients of the inequality
constraints |
H |
numeric vector containing the right-hand side of the inequality constraints. |
tol |
tolerance (for inequality constraints). |
verbose |
logical to print warnings and messages. |
upper , lower |
vector containing upper and lower bounds on the unknowns. If one value, it is assumed to apply to all unknowns. If a vector, it should have a length equal to the number of unknowns; this vector can contain NA for unbounded variables. The upper and lower bounds are added to the inequality conditions G*x>=H. |
a list containing:
X |
vector containing the solution of the least distance problem. |
residualNorm |
scalar, the sum of absolute values of residuals of violated inequalities; should be zero or very small if the problem is feasible. |
solutionNorm |
scalar, the value of the quadratic function at the
solution, i.e. the value of |
IsError |
logical, |
type |
the string "ldp", such that how the solution was obtained can be traced. |
numiter |
the number of iterations. |
Karline Soetaert <karline.soetaert@nioz.nl>
Lawson C.L.and Hanson R.J. 1974. Solving Least Squares Problems, Prentice-Hall
Lawson C.L.and Hanson R.J. 1995. Solving Least Squares Problems. SIAM classics in applied mathematics, Philadelphia. (reprint of book)
ldei
, which includes equalities.
# parsimonious (simplest) solution
G <- matrix(nrow = 2, ncol = 2, data = c(3, 2, 2, 4))
H <- c(3, 2)
ldp(G, H)
# imposing bounds on the first unknown
ldp(G, H, lower = c(1, NA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.