Applet. Finding Geometric Medians and Geometric Centers on a circle from discrete sample points.

[size=85] Let there be some distribution created by discrete set of points in a Euclidean space. Consider [b]two estimators of location[/b] of this distribution:[br][color=#333333]the[/color][color=#ff7700] [url=https://en.wikipedia.org/wiki/Geometric_median]geometric median[/url] (GM) [/color]-the [i][color=#0000ff]point[/color][/i] [i]minimizing[/i] [b]the sum of distances to the all points[/b] and[br]the [url=https://en.wikipedia.org/wiki/Centroid]geometric center[/url][color=#ff00ff] (GC)[/color], defined as[url=https://en.wikipedia.org/wiki/Geometric_median#Computation] [color=#0000ff]point[/color][/url] minimizing the [b]sum of the squares of the distances[/b] to each point.[br] We generalize these estimates to the case when they are searched in a restricted region, for example, finding these estimates on a circle of radius R.[br][/size][size=85]lP:={p[sub]1[/sub],p[sub]2[/sub],p[sub]3[/sub],p[sub]4[/sub],p[sub]5[/sub],p[sub]6[/sub]} -discrete sample of movable points in the x-y plane.[br]f(x) =Sum(Zip(sqrt((R* cos(x) - x(b))² + (R* sin(x) - y(b))²), b, lP))} [br]f[sub]q[/sub](x) = Sum(Zip(( (R* cos(x) - x(b))² + (R* sin(x) - y(b))², b, lP)). [br]Functions: f(x) -Sum of distances, f[sub]q[/sub](x) -Sum of the squares of distances between a set of points lP and a [color=#8e7cc3]Test Point x0[/color]=(R; x) on a circle c.[br][u][b]Problem:[/b][/u] use the [b][i][url=https://en.wikipedia.org/wiki/Lagrange_multiplier]method of Lagrange multipliers[/url] [/i][/b]to find [color=#ff0000]critical points[/color] [color=#ff0000]{c[sub]k[/sub]}[/color] of these functions on the the circle c(x,y):= x[sup]2[/sup]+y[sup]2[/sup]=R[sup]2[/sup]. [br] [color=#ff0000][b][size=100]☛[/size][/b][/color] For illustration: the vectors are attached at points [color=#ff0000]c[sub]k[/sub][/color]. [br][i][i] This applet is used to explore the distribution of [/i][i][color=#333333]geometric [/color][color=#ff7700]medians[/color][color=#333333] and [/color][color=#ff00ff]centers [/color][/i][color=#000000][i]on the circle of radius R, „induces“ by the discrete sample of movable points from lP in the x-y plane[/i][/color][color=#333333]. [/color] [br]Description in [url=https://www.geogebra.org/m/puqnepmv]https://www.geogebra.org/m/puqnepmv[/url].[br][color=#333333] In applet:[/color][color=#1e84cc] F -[url=https://en.wikipedia.org/wiki/Fermat_point]Ferma Point[/url]; [/color][color=#ff00ff]Cm- [url=https://en.wikipedia.org/wiki/Centroid]Centroid[/url]. [/color] [/i][/size]
[size=85][b]Some conclusions:[/b][br] In the case of the [i]Lagrange problem[/i] -[i]extremizing[/i] the [b]sum of distances[/b] from sample points lP to points on the circle, there are exact solutions and iterative solutions -[i][b]button[/b][/i]: critical points: max/min. The results coincide with a high degree. In the [color=#b45f06][b]Extremum[sub]f[/sub][/b] [/color][color=#333333]table[/color], you can see the relative deviation of errors.[br] By changing the location of points from the lP set, you can verify the validity of the above conclusions. I used these iterative methods for the case of a more complex problem -finding extreme points on a sphere.[br] In the future, the critical points: local maxima and minima, and saddle points will be called [color=#ff7700]geometric medians[/color] of points from lP in a restricted region -circle.[br] In the case of the Lagrange problem -[i][i]extremizing[/i][/i] of the [b]sum of the [/b][b]squares of the distances[/b], you can find explicit formulas - its coordinates are associated with the average values of the coordinates of points. In this case, the problem has only two critical points -two antipodal points: the local maximum and minimum. This points are on the same axis passing through the center of the circle O and the center of mass [color=#ff00ff]Cm[/color] and will be called [color=#ff00ff]geometric centers[/color] of points from lP in a [i]restricted region[/i] -circle .[/size]
Geometric Medians on the circle
[size=85]-[color=#1e84cc]Fermi Point F[/color], [br]-{c[sub]k[/sub]} -[color=#ff7700]Geometric Medians[/color] on the circle,[br]- f=f(x)-[b]Sum of distances [/b]from a point x[sub]0[/sub]=(R; x) on the circle to the discrete set lP={p1, p2,...,p6} of sample points in the x-y plane.[br]-the resultant of all unit vectors from the set of points lP to each critical point c[sub]k[/sub] ([color=#ff7700]Geometric Medians[/color] point) is parallel to its positional vector c[sub]k[/sub], i.e. the angle Δφ[sub]k[/sub] between these two vectors is 0 or π (see in the table) .[br]-Local and global [color=#ff0000]maxima[/color] and [color=#0000ff]minima[/color] for f(x)[br]-[color=#980000]Table[/color] of relative accuracy of finding [color=#ff7700]critical points[/color] obtained by iterative methods (click on checkbox "[color=#980000]Extremum[sub]f[/sub][/color]").[br][i][color=#ff0000][b]-[/b]Critical points[/color][/i] for the functions [color=#b6d7a8]f(x) [/color]depending on the angular position of the Test Point [color=#9900ff]x[sub]0[/sub][/color] on the circle.[/size][br][br]
Geometric Centers on the circle
[size=85]-[color=#ff00ff]Cm[/color] : Center of mass, centroid or geometric center [br]- f=f[sub]q[/sub](x) -[b]Sum of squares of the distances[/b] from a point (R; x) on the circle to the discrete set lP={p1, p2,...,p6} of sample points in the x-y plane.[br]- [color=#ff00ff]2[/color] [color=#ff00ff]Geometric Centers[/color] on the circle [color=#0000ff]min[sub]q[/sub][/color] and [color=#ff0000]max[sub]q.[br][/sub][/color][/size]-[size=85][i][color=#ff0000]Critical points[/color][/i] for the functions [color=#ff00ff]f[sub]q[/sub](x) [/color]depending on the angular position of the Test Point [color=#9900ff]x[sub]0[/sub][/color] on the circle.[/size][br]
[size=85][b]Applets in a [url=https://www.geogebra.org/m/u7zq6f3e]book[/url]:[/b][br] [url=https://www.geogebra.org/m/puqnepmv]Description[/url]. Finding Geometric Medians and Geometric Centers on a circle from discrete sample points.[br] [url=https://www.geogebra.org/m/qpmtdkuw]Applet[/url]. Finding Geometric Medians and Geometric Centers on a circle from discrete sample points.[br][url=https://www.geogebra.org/m/zhjadztw]Finding[/url] the location of geometric medians on the circle of discrete sample points depending on the position of the test point.[br] [url=https://www.geogebra.org/m/pjaqednw]Method[/url] of Lagrange multipliers. Relative positioning of repulsive movable points on a circle.[br][url=https://www.geogebra.org/m/d9ytv4wg]Generating[/url] an extreme arrangements of points on a circle[br][url=https://www.geogebra.org/m/uuz6h7xq]Generating[/url] an extreme arrangements of points on a sphere[br][url=https://www.geogebra.org/m/b5zcy52h]Generating[/url] an extreme arrangements of points on a sphere with more structured calculation program-GeoGebra Forum-[br][url=https://help.geogebra.org/topic/geogebra-windows-portable-zip-for-december]https://help.geogebra.org/topic/geogebra-windows-portable-zip-for-december[/url][/size][br][br]
Iterative methods for optimization -button: critical points: max/min
[size=85]ltest[sub]2[/sub] = Sequence((R; 2π / na j), j, 0, na ) -[i]Starting points for iterative methods[/i][br][br]lZmax=CopyFreeObject(Zip(Last[IterationList((0,0)+R UnitVector(Sum[Zip(UnitVector(Z1 - r), r, lP)]), Z1, {a}, 300),1 ],a, ltest[sub]2[/sub]))[br] lZmax' = CopyFreeObject(Unique(Zip((R; round(Angle(a), 16)), a, Flatten(lZmax))) )[br][br] lZmin=CopyFreeObject(Zip[Last[IterationList((0,0 )+ R UnitVector[ Sum[Zip[(p/ Length(p - Z2)),p,lP ]] ] , Z2, {a}, 300),1 ],a, ltest[sub]2[/sub]])[br]lZmin' = CopyFreeObject(Unique(Zip((R; round(Angle(a), 16)), a, Flatten(lZmin))) )[/size]

Information: Applet. Finding Geometric Medians and Geometric Centers on a circle from discrete sample points.