Stats.WinsorizedMean Method

Returns the Winsorized mean of the variable..

Definition

Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0
C#
public static double WinsorizedMean(
	Vector<double> values,
	double percent
)

Parameters

values  Vector<Double>
A Vector<T> of Double.
percent  Double
The percentage of extreme values to restrict before evaluating the mean.

Return Value

Double
The Winsorized mean of the variable.

Remarks

The Winsorized mean is similar to the trimmed mean. However, instead of discarding the values outside the range, they are set to the highest or lowest value. The percentage applies to both tails combined. The retained count is rounded down; any extra restricted observation is taken from the upper tail. At 20%, ten observations retain eight central values and restrict one observation at each end. An empty observed sample or a retained count of zero returns NaN. Percentages at or below zero return the mean; percentages at or above 100 return the median.

Exceptions

See Also