Robust Statistics
StatsBase.trim
— Function.trim(x; prop=0.0, count=0)
Return a copy of x
with either count
or proportion prop
of the highest and lowest elements removed. To compute the trimmed mean of x
use mean(trim(x))
; to compute the variance use trimvar(x)
(see trimvar
).
Example
julia> trim([1,2,3,4,5], prop=0.2)
3-element Array{Int64,1}:
2
3
4
StatsBase.winsor
— Function.winsor(x; prop=0.0, count=0)
Return a copy of x
with either count
or proportion prop
of the lowest elements of x
replaced with the next-lowest, and an equal number of the highest elements replaced with the previous-highest. To compute the Winsorized mean of x
use mean(winsor(x))
.
Example
julia> winsor([1,2,3,4,5], prop=0.2)
5-element Array{Int64,1}:
2
2
3
4
4
StatsBase.trimvar
— Function.trimvar(x; prop=0.0, count=0)
Compute the variance of the trimmed mean of x
. This function uses the Winsorized variance, as described in Wilcox (2010).