distsumlpmin is the distsummin function for the norm (lp). This function returns the solution of the minimization problem. Mainly for internal use.
distsumlpmin( o, x =0, y =0, p =2, max.iter =100, eps =0.001, verbose =FALSE, algorithm ="Weiszfeld",...)
Arguments
o: An object of loca.p class.
x: The x coordinate of the starting point. It's default value is 0.
y: The y coordinate of the starting point. It's default value is 0.
max.iter: Maximum number of iterations allowed. It's default value is 100000.
eps: The module of the gradient in the stop rule. It's default value is 1e-3.
verbose: If TRUE the function produces detailed output. It's default value is FALSE.
algorithm: The method to be use. For this version of the package, the valid values are: "gradient" for a gradient based method, "search" for local search method (this option is deprecated), "ucminf" for optimization with ucminf from ucminf package, and "Weiszfeld" for the Weiszfeld method or any of the valid method for optim function, now "Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN". "Weiszfeld" is the default value.
Returns
distsummin returns an array with the coordinates of the solution point.
Details
The algorithms Weiszfeld and gradient include and optimality test for demand points. The Weiszfeld version of the algorithm also implements slow convergence test and accelerator procedure.
If p<1 thus lp is not a norm, so, only p≥1 are valid values.
Since l2 norm is the Euclidean norm, when p=2distsumlpmin are equal to distsummin. But the computations involved are greater for the first form.
max.iter for SANN algorithm is the number of evaluation of objective function, so this method usually requires large values of max.iter to reach optimal value
The function zsummin is deprecated and will be removed from new versions of the package.
Examples
# A new unweighted loca.p objectloca <- loca.p(x = c(-1,1,1,-1), y = c(-1,-1,1,1))# Compute the minimumsol<-distsummin(loca)# Show the resultsol
# Evaluation of the objective function at solution pointdistsum(loca, sol[1], sol[2])