I noticed that variation() and potentially other derived methods in StatsBase don't seem to have the "corrected" optional keyword argument. variation() calls std() I guess, where one can optionally switch off correcting for degrees of freedom (division by N or N-1). I wondered if it makes sense to add this option also for variation(), and maybe other methods that rely on std() or similar, too.
In applications I find this particularly relevant when computing coefficients of variations of single-element arrays (as it may happen when array length is itself probabilistic). For example:
using StatsBase
a = [1.0]
variation(a) # NaN
variation(a, corrected=true) # not possible, but should also give NaN
variation(a, corrected=false) # not possible, but should give 0.0
Hey all!
I noticed that
variation()
and potentially other derived methods in StatsBase don't seem to have the "corrected" optional keyword argument.variation()
callsstd()
I guess, where one can optionally switch off correcting for degrees of freedom (division by N or N-1). I wondered if it makes sense to add this option also forvariation()
, and maybe other methods that rely onstd()
or similar, too.In applications I find this particularly relevant when computing coefficients of variations of single-element arrays (as it may happen when array length is itself probabilistic). For example:
My version is
StatsBase v0.33.16
.Best