Stats.Quantiles Method

Definition

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

Overload List

Quantiles(Double[], Double[]) Gets the specified quantiles.
Quantiles(Vector<Double>, Double[]) Gets the specified quantiles.
Quantiles<T>(Vector<T>, Double[]) Gets the specified quantiles.

Quantiles(Double[], Double[])

Gets the specified quantiles.
C#
public static double[] Quantiles(
	double[] values,
	double[] probabilities
)

Parameters

values  Double[]
A Double array.
probabilities  Double[]
An array of values between 0 and 1, inclusive.

Return Value

Double[]
A Double array containing the quantiles for to the percentage specified by the corresponding elements of probabilities.

Remarks

If a 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.

Quantiles(Vector<Double>, Double[])

Gets the specified quantiles.
C#
public static double[] Quantiles(
	this Vector<double> values,
	params double[] probabilities
)

Parameters

values  Vector<Double>
A vector.
probabilities  Double[]
An array of values between 0 and 1, inclusive.

Return Value

Double[]
A Double array containing the quantiles for the percentage specified by the corresponding elements of probabilities.

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 a 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.

Quantiles<T>(Vector<T>, Double[])

Gets the specified quantiles.
C#
public static T[] Quantiles<T>(
	Vector<T> values,
	double[] probabilities
)

Parameters

values  Vector<T>
A Vector<T>.
probabilities  Double[]
An array of values between 0 and 1, inclusive.

Type Parameters

T

Return Value

T[]
A Double array containing the quantiles for to the percentage specified by the corresponding elements of probabilities.

Remarks

If a 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.

See Also