zsum {orloca} | R Documentation |
The objective function and the gradient function for the min-sum location problem.
zsum(o, x=0, y=0) zsumgra(o, x=0, y=0)
o |
An object of loca.p class. |
x |
The x coordinate of the point to be evaluated. |
y |
The y coordinate of the point to be evaluated. |
zsum
returns the objective function of the min-sum location
problem, sum_{a_i in o} w_i d(a_i, (x,y)), where d(a_i, (x,y)) gives the
euclidean distances between a_i and (x,y).
zsumgra
returns the gradient vector of the function zsum
.
See also orloca-package
and zsummin
.
# An unweighted new loca.p object loca <- loca.p(x = c(-1, 1, 1, -1), y = c(-1, -1, 1, 1)) # Evaluation of zsum at (0, 0) zsum(loca) # Evaluation of zsum at (1, 3) zsum(loca, 1, 3) # The gradient function zsumgra(loca, 1, 3)