Stats.Percentile Method

Definition

Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4

Overload List

Percentile(Double[], Int32) Gets the specified percentile.
Percentile(Vector<Double>, Double) Gets the specified percentile.
Percentile<T>(Vector<T>, Int32, QuantileType) Gets the specified percentile.

Percentile(Double[], Int32)

Gets the specified percentile.
C#
public static double Percentile(
	double[] values,
	int percent
)

Parameters

values  Double[]
A Double array.
percent  Int32
An integer between 0 and 100, inclusive.

Return Value

Double
The percentile corresponding to the percentage specified by percent.

Remarks

If the percentile falls between two observations, it is interpolated between the adjacent observations.

Exceptions

ArgumentNullException

values is null.

ArgumentOutOfRangeException

percent is less than zero or greater than 100.

Percentile(Vector<Double>, Double)

Gets the specified percentile.
C#
public static double Percentile(
	this Vector<double> values,
	double percent
)

Parameters

values  Vector<Double>
A vector.
percent  Double
An integer between 0 and 100, inclusive.

Return Value

Double
The percentile corresponding to the percentage specified by percent.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<Double>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

If the percentile falls between two observations, it is interpolated between the adjacent observations.

Exceptions

ArgumentNullException

values is null.

ArgumentOutOfRangeException

percent is less than zero or greater than 100.

Percentile<T>(Vector<T>, Int32, QuantileType)

Gets the specified percentile.
C#
public static T Percentile<T>(
	this Vector<T> values,
	int percent,
	QuantileType type = QuantileType.R
)

Parameters

values  Vector<T>
A Vector<T>.
percent  Int32
An integer between 0 and 100, inclusive.
type  QuantileType  (Optional)
The type of quantile to compute.

Type Parameters

T

Return Value

T
The percentile corresponding to the percentage specified by percent.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

If the percentile falls between two observations, it is interpolated between the adjacent observations.

Exceptions

ArgumentNullException

values is null.

ArgumentOutOfRangeException

percent is less than zero or greater than 100.

See Also