Hi Brian and Bo
I think the answer to both of your questions is that the algorithm is
calculating an unbiased estimate of the var/stddev.
This is a reprise of an old thread that Devon started in 2016.

http://www.jsoftware.com/pipermail/programming/2016-March/044861.html

There is a link there to the formula which appears to be from a reputable
source.
https://www.itl.nist.gov/div898/software/dataplot/refman2/ch2/weightsd.pdf

On Sun, 28 Feb 2021, 06:18 'Bo Jacoby' via Programming, <
[email protected]> wrote:

>  Shouldn't the monadic
>
>    stddev 1 1 0 0 4 1 2 1 0 # 2 3 5 7 11 13 17 19 23
>
> 5.60258
>
> equal the dyadic
>
>    1 1 0 0 4 1 2 1 0 stddev 2 3 5 7 11 13 17 19 23
>
> 5.82237
>
> ?
>     Den lørdag den 27. februar 2021 14.12.10 CET skrev Ric Sherlock <
> [email protected]>:
>
>  Any objections to redefining mean, dev, ssdev, var, stddev in the
> stats/base add on to calculate the weighted equivalents if invoked
> dyadically?
> I. E.
>
> wmean=: +/@[ %~ +/@:*
> wdev=: ] -"_1 _ wmean
> wssdev=: [ +/@:* *:@wdev
> wvar=: (#@-.&0 %~ <:@#@-.&0 * +/)@[ %~ wssdev
> wstddev=: %:@wvar
>
> mean=: (+/ % #) : wmean
> dev=: (-"_1 _ mean) : wdev
> ssdev=: (+/@:*:@dev) : wssdev
> var=: (ssdev % <:@#) : wvar
> stddev=: (%:@var) : wstddev
>
>   1 1 0 0 4 1 2 1 0 stddev 2 3 5 7 11 13 17 19 23
> 5.82237
>
>   stddev 2 3 5 7 11 13 17 19 23
> 7.45729
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to