Skip to content

Commit 128dc11

Browse files
authored
Merge pull request #169 from stevengj/patch-1
2 parents 39f6332 + 48d7a02 commit 128dc11

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Statistics.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ The algorithm returns an estimator of the generative distribution's variance
322322
under the assumption that each entry of `itr` is a sample drawn from the same
323323
unknown distribution, with the samples uncorrelated.
324324
For arrays, this computation is equivalent to calculating
325-
`sum((itr .- mean(itr)).^2) / (length(itr) - 1)`.
325+
`sum(abs2.(itr .- mean(itr))) / (length(itr) - 1)`.
326326
If `corrected` is `true`, then the sum is scaled with `n-1`,
327327
whereas the sum is scaled with `n` if `corrected` is
328328
`false` with `n` the number of elements in `itr`.
@@ -360,7 +360,7 @@ The algorithm returns an estimator of the generative distribution's variance
360360
under the assumption that each entry of `itr` is a sample drawn from the same
361361
unknown distribution, with the samples uncorrelated.
362362
For arrays, this computation is equivalent to calculating
363-
`sum((itr .- mean(itr)).^2) / (length(itr) - 1)`.
363+
`sum(abs2.(itr .- mean(itr))) / (length(itr) - 1)`.
364364
If `corrected` is `true`, then the sum is scaled with `n-1`,
365365
whereas the sum is scaled with `n` if `corrected` is
366366
`false` where `n` is the number of elements in `itr`.
@@ -441,7 +441,7 @@ The algorithm returns an estimator of the generative distribution's standard
441441
deviation under the assumption that each entry of `itr` is a sample drawn from
442442
the same unknown distribution, with the samples uncorrelated.
443443
For arrays, this computation is equivalent to calculating
444-
`sqrt(sum((itr .- mean(itr)).^2) / (length(itr) - 1))`.
444+
`sqrt.(sum(abs2.(itr .- mean(itr))) / (length(itr) - 1))`.
445445
If `corrected` is `true`, then the sum is scaled with `n-1`,
446446
whereas the sum is scaled with `n` if `corrected` is
447447
`false` with `n` the number of elements in `itr`.
@@ -485,7 +485,7 @@ The algorithm returns an estimator of the generative distribution's standard
485485
deviation under the assumption that each entry of `itr` is a sample drawn from
486486
the same unknown distribution, with the samples uncorrelated.
487487
For arrays, this computation is equivalent to calculating
488-
`sqrt(sum((itr .- mean(itr)).^2) / (length(itr) - 1))`.
488+
`sqrt.(sum(abs2.(itr .- mean(itr))) / (length(itr) - 1))`.
489489
If `corrected` is `true`, then the sum is scaled with `n-1`,
490490
whereas the sum is scaled with `n` if `corrected` is
491491
`false` with `n` the number of elements in `itr`.

0 commit comments

Comments
 (0)