VectorExtensions.Quantiles<T> Method

Gets the specified quantile.

Definition

Namespace: Numerics.NET.DataAnalysis
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
C#
public static Vector<T> Quantiles<T>(
	this Vector<T> values,
	IList<double> probabilities,
	QuantileType type = QuantileType.R,
	bool labels = false
)

Parameters

values  Vector<T>
A vector.
probabilities  IList<Double>
A vector of values between 0 and 1, inclusive that specify the quantiles to be computed.
type  QuantileType  (Optional)
The type of quantiles to compute.
labels  Boolean  (Optional)
If true, percentage labels are added to the result vector.

Type Parameters

T

Return Value

Vector<T>
A vector of the quantiles of values corresponding to the values in probabilities.

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 quantile falls between two observations, it is interpolated between the adjacent observations.

Exceptions

ArgumentNullException

values is null.

-or-

probabilities is null.

ArgumentException

One or more of the elements of probabilities is less than zero or greater than 1.

ArgumentOutOfRangeException

type is less than 1 or greater than 9.

See Also