Re: minimize avg distance to some points
- To: mathgroup at smc.vnet.net
- Subject: [mg38315] Re: minimize avg distance to some points
- From: Tom Burton <tburton at brahea.com>
- Date: Thu, 12 Dec 2002 01:33:00 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hello, On 12/10/02 1:21 AM, in article at4blv$emc$1 at smc.vnet.net, "Daniel Reeves" <dreeves at umich.edu> wrote: > Given a list of n-dimensional points, find a point that minimizes the > average distance to all the given points. > > ... > > Solve[eqs, {z[1], z[2], z[3]}] > > But Mathematica chokes on that... > > Any ideas for a better algorithm to find the total-distance minimizing > point (this should work for any dimensions; 16 in my case)? Well, I happen to know the answer in three dimensions: In[15]:= centroid = Plus@@points/Length[points] Out[15]= 11 13 15 {--, --, --} 2 2 2 In[16]:= eqs /. Thread[Array[z,3]->centroid] Out[16]= {True, True, True} Maybe you can extend this to n dimensions. I cannot do so, at least not trivially. However, FindRoot worked nicely in the 16-dimensional examples I tried. Tom Burton