Stats.Ranks Method

Definition

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

Overload List

Ranks(DateTime[]) Returns the ranks of the observations.
Ranks(Vector<Double>) Returns the ranks of the observations.
Ranks(DateTime[], RankTiebreaker, TimeSpan) Returns the ranks of the observations.
Ranks<T>(T[]) Returns the ranks of the observations.
Ranks<T>(T[], RankTiebreaker, T) Returns the ranks of the observations.
Ranks<T>(ReadOnlySpan<T>, RankTiebreaker, T) Returns the ranks of the observations.
Ranks<T>(Vector<T>, RankTiebreaker, T) Returns the ranks of the observations.

Ranks(DateTime[])

Returns the ranks of the observations.
C#
public static double[] Ranks(
	DateTime[] values
)

Parameters

values  DateTime[]
A Double array.

Return Value

Double[]
A Double array containing the ranks of each observation.

Remarks

The smallest observation has rank 1. If several observations have the same value, then the average of the ranks is used. The rank for missing values is NaN.

Exceptions

ArgumentNullException

values is null.

Ranks<T>(T[])

Returns the ranks of the observations.
C#
public static double[] Ranks<T>(
	T[] values
)

Parameters

values  T[]
A Double array.

Type Parameters

T

Return Value

Double[]
A Double array containing the ranks of each observation.

Remarks

The smallest observation has rank 1. If several observations have the same value, then the average of the ranks is used. The rank for missing values is NaN.

Exceptions

ArgumentNullException

values is null.

Ranks(Vector<Double>)

Returns the ranks of the observations.
C#
public static Vector<double> Ranks(
	this Vector<double> values
)

Parameters

values  Vector<Double>
A Double array.

Return Value

Vector<Double>
A Double array containing the ranks of each observation.

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

The smallest observation has rank 1. If several observations have the same value, then the average of the ranks is used. The rank for missing values is NaN.

Exceptions

ArgumentNullException

values is null.

Ranks(DateTime[], RankTiebreaker, TimeSpan)

Returns the ranks of the observations.
C#
public static double[] Ranks(
	DateTime[] values,
	RankTiebreaker tiebreaker,
	TimeSpan tolerance
)

Parameters

values  DateTime[]
A Double array.
tiebreaker  RankTiebreaker
A RankTiebreaker value that specifies how to assign the ranks of tied observations.
tolerance  TimeSpan
A TimeSpan value that specifies the largest difference between values for which ranks should be considered tied.

Return Value

Double[]
A Double array containing the ranks of each observation.

Remarks

The smallest observation has rank 1. Observations that are within the value tolerance of each other are considered equal. If several values are equal, then the rank is assigned using the method specified by tiebreaker.

Exceptions

ArgumentNullException

values is null.

Ranks<T>(T[], RankTiebreaker, T)

Returns the ranks of the observations.
C#
public static double[] Ranks<T>(
	this T[] values,
	RankTiebreaker tiebreaker,
	T tolerance
)

Parameters

values  T[]
An array of values.
tiebreaker  RankTiebreaker
A RankTiebreaker value that specifies how to assign the ranks of tied observations.
tolerance  T
The absolute tolerance used to decide whether two values are considered equal.

Type Parameters

T

Return Value

Double[]
A Double array containing the ranks of each observation.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type 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

The smallest observation has rank 1. Observations that are within the value tolerance of each other are considered equal. If several values are equal, then the rank is assigned using the method specified by tiebreaker. The rank for missing values is NaN.

Exceptions

ArgumentNullException

values is null.

Ranks<T>(ReadOnlySpan<T>, RankTiebreaker, T)

Returns the ranks of the observations.
C#
public static double[] Ranks<T>(
	this ReadOnlySpan<T> values,
	RankTiebreaker tiebreaker,
	T tolerance
)

Parameters

values  ReadOnlySpan<T>
An array of values.
tiebreaker  RankTiebreaker
A RankTiebreaker value that specifies how to assign the ranks of tied observations.
tolerance  T
The absolute tolerance used to decide whether two values are considered equal.

Type Parameters

T

Return Value

Double[]
A Double array containing the ranks of each observation.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ReadOnlySpan<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

The smallest observation has rank 1. Observations that are within the value tolerance of each other are considered equal. If several values are equal, then the rank is assigned using the method specified by tiebreaker. The rank for missing values is NaN.

Exceptions

ArgumentNullException

values is null.

Ranks<T>(Vector<T>, RankTiebreaker, T)

Returns the ranks of the observations.
C#
public static Vector<double> Ranks<T>(
	this Vector<T> values,
	RankTiebreaker tiebreaker,
	T tolerance
)

Parameters

values  Vector<T>
A vector of values.
tiebreaker  RankTiebreaker
A RankTiebreaker value that specifies how to assign the ranks of tied observations.
tolerance  T
The absolute tolerance used to decide whether two values are considered equal.

Type Parameters

T

Return Value

Vector<Double>
A Double array containing the ranks of each observation.

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

The smallest observation has rank 1. Observations that are within the value tolerance of each other are considered equal. If several values are equal, then the rank is assigned using the method specified by tiebreaker. The rank for missing values is NaN.

Exceptions

ArgumentNullException

values is null.

See Also