WinsorizedMean

WinsorizedMean[list,f]

gives the mean of the elements in list after replacing the fraction f of the smallest and largest elements by the remaining extreme values.

WinsorizedMean[list,{f1,f2}]

gives the mean when the fraction f1 of the smallest elements and the fraction f2 of the largest elements are replaced by the remaining extreme values.

WinsorizedMean[list]

gives the 5% winsorized mean WinsorizedMean[list,0.05].

WinsorizedMean[dist,]

gives the winsorized mean of a univariate distribution dist.

Details

  • WinsorizedMean gives a robust estimate of the mean, with more extreme values replaced by less extreme ones.
  • The winsorizing fraction is determined by the parameters f1 and f2, which indicate the fraction f1 of the smallest elements and the fraction f2 of the largest elements to be replaced by the remaining extreme values.
  • WinsorizedMean[list,{f1,f2}] gives the mean of Clip[list,{z1,z2}] where z1 equals RankedMin[list,1+], z2 equals RankedMax[list,1+], and n equals the length of list. »
  • WinsorizedMean of a univariate WeightedData data gives the weighted mean of the censored data. »
  • WinsorizedMean[{{x1,y1,},{x2,y2,},},f] gives {WinsorizedMean[{x1,x2,},f],WinsorizedMean[{y1,y2,},f],}. »
  • WinsorizedMean[dist,{f1,f2}] gives Mean[CensoredDistribution[Quantile[dist,{f1,1-f2}],dist]] for a univariate distribution dist. »

Examples

open allclose all

Basic Examples  (4)

Winsorized mean after removing extreme values:

Winsorized mean after removing the smallest extreme values:

Winsorized mean of a list of dates:

Winsorized mean of a symbolic distribution:

Scope  (11)

Data  (10)

Exact input yields exact output:

Approximate input yields approximate output:

Winsorized mean of a matrix gives columnwise means:

Winsorized mean of a large array:

SparseArray data can be used just like dense arrays:

WinsorizedMean of a univariate WeightedData:

Compare with the mean of the unweighted data:

Winsorized mean of a TimeSeries:

The winsorized mean depends only on the values:

Winsorized mean works with data involving quantities:

Compute winsorized mean of dates:

Compute winsorized mean of times:

List of times with different time zone specifications:

Distributions  (1)

Winsorized mean of a univariate distribution:

Applications  (3)

Obtain a robust estimate of the location when outliers are present:

Extreme values have a large influence on the mean:

Simulate a trajectory with heavy-tailed measurement noise:

The underlying signal and simulated path with noise:

Smooth the trajectory using a moving WinsorizedMean:

Increasing the block size gives a smoother trajectory:

Find a winsorized mean for the heights of children in a class:

The 5% winsorized mean:

Compare few winsorized means:

Plot the winsorized mean as a function of the fraction parameter:

Properties & Relations  (5)

A 0% WinsorizedMean is equivalent to Mean:

WinsorizedMean approaches Median as f approaches 1/2:

WinsorizedMean of a distribution is the mean of its CensoredDistribution:

Mean of the CensoredDistribution with appropriate bounds:

WinsorizedMean of a sample gives an estimate of the mean of a censored distribution:

Mean of the CensoredDistribution with appropriate bounds:

TrimmedMean drops the data beyond a certain quantile level, then computes the sample mean:

WinsorizedMean clips the data beyond a certain quantile level, then computes the sample mean:

Plot the sorted data against the sample with elements removed and the clipped sample:

Possible Issues  (1)

WinsorizedMean works only with numeric input:

Wolfram Research (2017), WinsorizedMean, Wolfram Language function, https://reference.wolfram.com/language/ref/WinsorizedMean.html (updated 2024).

Text

Wolfram Research (2017), WinsorizedMean, Wolfram Language function, https://reference.wolfram.com/language/ref/WinsorizedMean.html (updated 2024).

CMS

Wolfram Language. 2017. "WinsorizedMean." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/WinsorizedMean.html.

APA

Wolfram Language. (2017). WinsorizedMean. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WinsorizedMean.html

BibTeX

@misc{reference.wolfram_2024_winsorizedmean, author="Wolfram Research", title="{WinsorizedMean}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/WinsorizedMean.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_winsorizedmean, organization={Wolfram Research}, title={WinsorizedMean}, year={2024}, url={https://reference.wolfram.com/language/ref/WinsorizedMean.html}, note=[Accessed: 21-November-2024 ]}