* Re: [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector [not found] ` <E1Zc0yu-0000LD-Ah@vcs.savannah.gnu.org> @ 2015-09-16 13:21 ` Stefan Monnier 2015-09-16 13:46 ` David Kastrup ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Stefan Monnier @ 2015-09-16 13:21 UTC (permalink / raw) To: emacs-devel; +Cc: Jay Belanger -*- mode: nit-pick -*- > +Another commonly used mean, the RMS (root-mean-square), can be computed > +for a vector of numbers by using the @kbd{u R} I must admit that I don't use Calc very often, and read its manual even less often, so clearly I'm taking this out of context, but in any case: To me a "vector" has a rather specific meaning, and taking the root mean square of a vector doesn't make much sense. Instead, I like to take the rms of a *set* of numbers (which may be provided by packaging them in a vector, of course). Stefan ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector 2015-09-16 13:21 ` [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector Stefan Monnier @ 2015-09-16 13:46 ` David Kastrup 2015-09-16 14:14 ` Stefan Monnier 2015-09-16 13:55 ` Jay Belanger 2015-09-16 14:31 ` Eli Zaretskii 2 siblings, 1 reply; 6+ messages in thread From: David Kastrup @ 2015-09-16 13:46 UTC (permalink / raw) To: Stefan Monnier; +Cc: Jay Belanger, emacs-devel Stefan Monnier <monnier@IRO.UMontreal.CA> writes: > -*- mode: nit-pick -*- > >> +Another commonly used mean, the RMS (root-mean-square), can be computed >> +for a vector of numbers by using the @kbd{u R} > > I must admit that I don't use Calc very often, and read its manual even > less often, so clearly I'm taking this out of context, but in any case: > > To me a "vector" has a rather specific meaning, and taking the root mean > square of a vector doesn't make much sense. Instead, I like to take the > rms of a *set* of numbers (which may be provided by packaging them in > a vector, of course). Why would you ever want to do that? It may at best make sense for a finite _multiset_ (which can conveniently be represented by vector elements). The only difference then is that the members of a multiset have no order. But once you move to infinite measures as the base, RMS is still well-defined but you'd rarely want to remove the order by only viewing cumulative density functions. At any rate, you could do s/vector of numbers/the numbers in a vector/ but indeed that may suggest that it may not count 1 twice in [1;2;1] because the "numbers" are just 1 and 2. So one would probably rather do s/vector of numbers/the vector elements/. -- David Kastrup ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector 2015-09-16 13:46 ` David Kastrup @ 2015-09-16 14:14 ` Stefan Monnier 0 siblings, 0 replies; 6+ messages in thread From: Stefan Monnier @ 2015-09-16 14:14 UTC (permalink / raw) To: David Kastrup; +Cc: Jay Belanger, emacs-devel > Why would you ever want to do that? It may at best make sense for a > finite _multiset_ (which can conveniently be represented by vector Right, sorry, I meant multiset. Stefan ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector 2015-09-16 13:21 ` [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector Stefan Monnier 2015-09-16 13:46 ` David Kastrup @ 2015-09-16 13:55 ` Jay Belanger 2015-09-16 14:31 ` Eli Zaretskii 2 siblings, 0 replies; 6+ messages in thread From: Jay Belanger @ 2015-09-16 13:55 UTC (permalink / raw) To: Stefan Monnier; +Cc: jay.p.belanger, emacs-devel Stefan Monnier <monnier@IRO.UMontreal.CA> writes: >> +Another commonly used mean, the RMS (root-mean-square), can be computed >> +for a vector of numbers by using the @kbd{u R} This documentation was already in the Calc manual, simply commented out. I uncommented it and put in the (new) correct keybinding. > To me a "vector" has a rather specific meaning, and taking the root mean > square of a vector doesn't make much sense. Instead, I like to take the > rms of a *set* of numbers (which may be provided by packaging them in > a vector, of course). Yes; what's more, the documentation here doesn't match the documentation of the other statistics functions. I changed it to match the others, and now it refers to the rms of data values rather than a vector. Jay ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector 2015-09-16 13:21 ` [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector Stefan Monnier 2015-09-16 13:46 ` David Kastrup 2015-09-16 13:55 ` Jay Belanger @ 2015-09-16 14:31 ` Eli Zaretskii 2015-09-16 14:52 ` David Kastrup 2 siblings, 1 reply; 6+ messages in thread From: Eli Zaretskii @ 2015-09-16 14:31 UTC (permalink / raw) To: Stefan Monnier; +Cc: jay.p.belanger, emacs-devel > From: Stefan Monnier <monnier@IRO.UMontreal.CA> > Date: Wed, 16 Sep 2015 09:21:40 -0400 > Cc: Jay Belanger <jay.p.belanger@gmail.com> > > -*- mode: nit-pick -*- > > > +Another commonly used mean, the RMS (root-mean-square), can be computed > > +for a vector of numbers by using the @kbd{u R} > > I must admit that I don't use Calc very often, and read its manual even > less often, so clearly I'm taking this out of context, but in any case: > > To me a "vector" has a rather specific meaning, and taking the root mean > square of a vector doesn't make much sense. Instead, I like to take the > rms of a *set* of numbers (which may be provided by packaging them in > a vector, of course). As long as we are nit-picking, the result of root-mean-square generally depends on the order of the values (due to finite precision of FP calculations). So it's not really an unordered set. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector 2015-09-16 14:31 ` Eli Zaretskii @ 2015-09-16 14:52 ` David Kastrup 0 siblings, 0 replies; 6+ messages in thread From: David Kastrup @ 2015-09-16 14:52 UTC (permalink / raw) To: Eli Zaretskii; +Cc: jay.p.belanger, Stefan Monnier, emacs-devel Eli Zaretskii <eliz@gnu.org> writes: >> From: Stefan Monnier <monnier@IRO.UMontreal.CA> >> Date: Wed, 16 Sep 2015 09:21:40 -0400 >> Cc: Jay Belanger <jay.p.belanger@gmail.com> >> >> -*- mode: nit-pick -*- >> >> > +Another commonly used mean, the RMS (root-mean-square), can be computed >> > +for a vector of numbers by using the @kbd{u R} >> >> I must admit that I don't use Calc very often, and read its manual even >> less often, so clearly I'm taking this out of context, but in any case: >> >> To me a "vector" has a rather specific meaning, and taking the root mean >> square of a vector doesn't make much sense. Instead, I like to take the >> rms of a *set* of numbers (which may be provided by packaging them in >> a vector, of course). > > As long as we are nit-picking, the result of root-mean-square > generally depends on the order of the values (due to finite precision > of FP calculations). So it's not really an unordered set. Calc generally calculates exact expressions unless you tell it not to. At any rate, the "squares" (for complex numbers, they should just be the sum of squares of real and imaginary part rather than a complex square) are actually all non-negative, so there is not a lot of cancellation going on. The precision of your result will be very slightly better if you do the summation from smallest to large. At any rate, given the amount of nits to be found by mailing list members, it might be prudent to employ the services of a debugger. -- David Kastrup ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-09-16 14:52 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20150916005352.1277.32898@vcs.savannah.gnu.org> [not found] ` <E1Zc0yu-0000LD-Ah@vcs.savannah.gnu.org> 2015-09-16 13:21 ` [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector Stefan Monnier 2015-09-16 13:46 ` David Kastrup 2015-09-16 14:14 ` Stefan Monnier 2015-09-16 13:55 ` Jay Belanger 2015-09-16 14:31 ` Eli Zaretskii 2015-09-16 14:52 ` David Kastrup
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.