Click or drag to resize
Ranks Class
Compute the ranks, normal scores, or exponential scores for a vector of observations.
Inheritance Hierarchy
SystemObject
  Imsl.StatRanks

Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
[SerializableAttribute]
public class Ranks

The Ranks type exposes the following members.

Constructors
  NameDescription
Public methodRanks
Constructor for the Ranks class.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodStatic memberExpectedNormalOrderStatistic
Returns the expected value of a normal order statistic.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetBlomScores
Gets the Blom version of normal scores for each observation.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetNormalScores
Gets the expected value of normal order statistics (for tied observations, the average of the expected normal scores).
Public methodGetRanks
Gets the rank for each observation.
Public methodGetSavageScores
Gets the Savage scores. (the expected value of exponential order statistics)
Public methodGetTukeyScores
Gets the Tukey version of normal scores for each observation.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetVanDerWaerdenScores
Gets the Van der Waerden version of normal scores for each observation.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyFuzz
The fuzz factor used in determining ties.
Public propertyRandom
The Random object.
Public propertyTieBreaker
The tie breaker for Ranks.
Top
Remarks

The class Ranks can be used to compute the ranks, normal scores, or exponential scores of the data in X. Ties in the data can be resolved in four different ways, as specified by property TieBreaker. The type of values returned can vary depending on the member function called:

GetRanks: Ordinary Ranks

For this member function, the values output are the ordinary ranks of the data in X. If X[i] has the smallest value among those in X and there is no other element in X with this value, then GetRanks(i) = 1. If both X[i] and X[j] have the same smallest value, then

if TieBreaker = 0, Ranks[i] = GetRanks([j] = 1.5

if TieBreaker = 1, Ranks[i] = Ranks[j] = 2.0

if TieBreaker = 2, Ranks[i] = Ranks[j] = 1.0

if TieBreaker = 3, Ranks[i] = 1.0 and Ranks[j] = 2.0

or Ranks[i] = 2.0 and Ranks[j] = 1.0.

GetBlomScores: Normal Scores, Blom Version

Normal scores are expected values, or approximations to the expected values, of order statistics from a normal distribution. The simplest approximations are obtained by evaluating the inverse cumulative normal distribution function, Cdf.InverseNormal, at the ranks scaled into the open interval (0, 1). In the Blom version (see Blom 1958), the scaling transformation for the rank r_i(1 \le r_i \le n
            , where n is the sample size is (r_i - 
            3/8)/(n + 1/4). The Blom normal score corresponding to the observation with rank r_i is

\Phi ^{ - 1} \left( {\frac{{r_i  - 3/8}}{{n 
            + 1/4}}} \right)

where \Phi(\cdot) is the normal cumulative istribution function.

Adjustments for ties are made after the normal score transformation. That is, if X[i] equals X[j] (within fuzz) and their value is the k-th smallest in the data set, the Blom normal scores are determined for ranks of k and k + 1, and then these normal scores are averaged or selected in the manner specified by TieBreaker, which is set by the property TieBreaker. (Whether the transformations are made first or ties are resolved first makes no difference except when averaging is done.)

GetTukeyScores: Normal Scores, Tukey Version

In the Tukey version (see Tukey 1962), the scaling transformation for the rank r_i is (r_i - 1/3)/(n + 1/3)
            . The Tukey normal score corresponding to the observation with rank r_i is

\Phi ^{ - 1} \left( {\frac{{r_i  - 1/3}}{{n + 
            1/3}}} \right)

Ties are handled in the same way as discussed above for the Blom normal scores.

GetVanDerWaerdenScores: Normal Scores, Van der Waerden Version

In the Van der Waerden version (see Lehmann 1975, page 97), the scaling transformation for the rank r_i is r_i/(n + 1). The Van der Waerden normal score corresponding to the observation with rank r_i is

\Phi ^{ - 1} \left( {\frac{{r_i }}{{n + 1}}} 
            \right)

Ties are handled in the same way as discussed above for the Blom normal scores.

GetNormalScores: Expected Value of Normal Order Statistics

The member function GetNormalScores returns the expected values of the normal order statistics. If the value in X[i] is the k-th smallest, then the value output in SCORE[i] is E(Z_k), where E(\cdot) is the expectation operator and Z_k is the k-th order statistic in a sample of size x.length from a standard normal distribution. Ties are handled in the same way as discussed above for the Blom normal scores.

GetSavageScores: Savage Scores

The member function GetSavageScores returns the expected values of the exponential order statistics. These values are called Savage scores because of their use in a test discussed by Savage (1956) (see Lehman 1975). If the value in X[i] is the k-th smallest, then the i-th output value output is E(Y_k), where Y_k is the k-th order statistic in a sample of size n from a standard exponential distribution. The expected value of the k-th order statistic from an exponential sample of size n is

\frac{1}{n} + \frac{1}{{n - 1}} +  \ldots + 
            \frac{1}{{n - k + 1}}

Ties are handled in the same way as discussed above for the Blom normal scores.

See Also

Reference

Other Resources