distsum and distsumgra functions with \(l_p\) norm. Mainly for internal use.
distsumlp(o, x = 0, y = 0, p = 2)distsumlp returns the objective function of the min-sum location problem with \(l_p\) norm, \(\sum_{a_i \in o} w_i d(a_i, (x,y))\), where \(d(a_i, (x,y))\) gives the distances between \(a_i\) and the point \((x,y)\) using \(l_p\) norm.
distsumlpgra returns the gradient vector of the function distsumlp. If \((x,y)\) is a demand point partial=T means ignore such point to compute the gradient. This option is mainly for internal use.
An object of loca.p class.
The x coordinate of the point to be evaluated.
The y coordinate of the point to be evaluated.
The \(l_p\) norm to use.
If \(p<1\) then \(l_p\) is not a norm, so only \(p>=1\) are valid values.
Since \(l_2\) norm is the Euclidean norm, when \(p=2\) distsumlp are equal to distsum, and distsumlpgra are equal to distsumgra.
But the computations involved are greater for the firsts form.
See also distsum, orloca-package and distsumlpmin.