Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #16205

Re: Another little puzzle

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.programming
Subject Re: Another little puzzle
Date 2023-01-01 01:24 +0000
Organization A noiseless patient Spider
Message-ID <87tu1bgi7o.fsf@bsb.me.uk> (permalink)
References (4 earlier) <864jtdtkt5.fsf@linuxsc.com> <87o7rlhtsv.fsf@bsb.me.uk> <878rioifnh.fsf@bsb.me.uk> <868rinskhk.fsf@linuxsc.com> <topmiu$4ps$1@gioia.aioe.org>

Show all headers | View raw


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> On 2022-12-31 15:42, Tim Rentsch wrote:
>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>
>>> For the "vector average", we convert the t(i) to unit vectors u(i) and
>>> we calculate the mean if the u(i) to get a vector m.  The "average", A,
>>> is just the direction of this vector -- another point on the unit
>>> circle.  In this case we are minimising the sum of squares of the
>>> /chord/ lengths between A and the t(i).
>> I think of this approach differently.  I take the time values
>> t(i) as being unit masses on the unit circle, and calculate the
>> center of mass.  As long as the center of mass is not the origin
>> we can project it from the origin to find a corresponding time
>> value on the unit circle (which in my case is done implicitly by
>> using atan2()).
>
> Center of mass of a set of ideal points (particles) and vector average are same:
>
>    CoM = Sum Mi * Ri / Sum Mi
>          i = 1..n      i = 1..n
>
> Mi = masses, Ri = vectors. If all Mi are same you get
>
>    CoM = Sum Ri / n
>          i = 1..n
>
>>> This distinction between arc lengths and chord lengths helps to
>>> visualise where these averages differ, and why the conventional
>>> average may seem more intuitive.
>> Interesting perspective.  I wouldn't call them chord lengths
>> because I think of a chord as being between two points both on
>> the same circle, and the center of mass is never on the unit
>> circle (not counting the case when all the time values are the
>> same).  Even so it's an interesting way to view the distinction.
>
> Arc length is proportional to angle:
>
>    L = Rα, R is radius, α is angle in radians.
>
> Averaging arcs is equivalent to averaging angles.

Sure.  I'm certain Tim knows that!  The question is what "average" are
we interested in.  An average, angle A, minimises

  Sum_{i=1,n} distance(A, t(i))^2

for some measure of distance.  The most common circular (or spherical)
average, sums the unit vectors and, where possible, projects the
resultant vector onto the unit circle.  This average, it turns out,
minimises the sum of squares of the chords between A and the t(i).

Another average, which is more complicated to calculate, minimises the
sum of squares of the arc lengths or, as you say, the angular distances
between A and the t(i).

>> Now that I think about it, finding the point that minimizes the
>> great circle distances squared would be at least computationally
>> unpleasant.
>
> See above, it is just angles to average.

Yes, but that's hard.  The simple average (just sum the unit vectors)
does not minimise the sum of squares of the angle differences, and,
despite being a reasonable concept, is not discussed in any of the text
I've been able to find.

-- 
Ben.

Back to comp.programming | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-30 01:00 +0000
  Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-29 23:25 -0800
    Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-30 14:04 +0000
      Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-31 00:24 +0000
        Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-31 06:42 -0800
          Re: Another little puzzle "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2022-12-31 17:04 +0100
            Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-01-01 01:24 +0000
            Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-01-08 07:45 -0800
              Re: Another little puzzle "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2023-01-08 17:17 +0100
                Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-01-08 20:41 +0000
                Re: Another little puzzle Richard Heathfield <rjh@cpax.org.uk> - 2023-01-08 21:14 +0000
                Re: Another little puzzle "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2023-01-08 22:31 +0100
                Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-01-09 03:25 +0000
                Re: Another little puzzle "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2023-01-09 11:22 +0100
                Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-01-09 20:37 +0000
                Re: Another little puzzle "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2023-01-10 09:06 +0100
                Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-01-11 02:41 +0000
                Re: Another little puzzle "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2023-01-11 10:01 +0100
                Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-01-12 01:00 +0000
                Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-01-10 23:36 -0800
                Re: Another little puzzle Y A <ya00000100000@yahoo.com> - 2023-01-11 02:39 -0800
          Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-01-01 01:10 +0000
            Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-01-08 07:17 -0800
              Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-01-08 19:43 +0000
                Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-01-08 19:59 +0000
                Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-01-10 23:25 -0800
      Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-31 06:20 -0800
        Re: Another little puzzle Augǝl <angel0000000001000000000000@mail.ee> - 2022-12-31 10:23 -0800

csiph-web