Stats.RanksInto<T> Method

Returns the ranks of the observations.

Definition

Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0
C#
public static double RanksInto<T>(
	this ReadOnlySpan<T> values,
	RankTiebreaker tiebreaker,
	T tolerance,
	Span<double> ranks
)

Parameters

values  ReadOnlySpan<T>
The observations to rank.
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.
ranks  Span<Double>
The span that receives the ranks.

Type Parameters

T

Return Value

Double
For Average, the sum of t * (t * t - 1) over groups of t tied observations; otherwise, zero.

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 within tolerance are tied. Missing observations receive NaN and do not contribute to the rank count.

Only the first values.Length destination elements are written. Overlapping input and destination spans are supported.

Exceptions

ArgumentExceptionThe destination is shorter than the input.

See Also