|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.stats.descriptive.rank.Rank
public class Rank
Rankin is a relationship between a set of items such that, for any two items, the first is either "ranked higher than", "ranked lower than" or "ranked equal to" the second. This is known as a weak order or total preorder of objects. It is not necessarily a total order of objects because two different objects can have the same ranking. The rankings themselves are totally ordered.
In statistics, "ranking" refers to the data transformation in which numerical or ordinal values are replaced by their rank when the data are sorted. It is important to note that ranks can sometimes have non-integer values for tied data values. Thus, in one way of treating tied data values, when there is an even number of copies of the same data value, the statistical rank (being the median rank of the tied data) can end in ½ or another fraction.
The R equivalent function is rank.
| Field Summary | |
|---|---|
double |
s
s = Σ(ti2 - ti) |
double |
t
t = Σ(ti3 - ti) |
| Constructor Summary | |
|---|---|
Rank(double[] arr)
Compute the sample ranks of the values using the machine epsilon as the tie threshold. |
|
Rank(double[] values,
double threshold)
Compute the sample ranks of the values. |
|
| Method Summary | |
|---|---|
double |
rank(int i)
Get the rank of the element arr[i]. |
double[] |
ranks()
Get a copy of the ranks. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final double t
public final double s
| Constructor Detail |
|---|
public Rank(double[] values,
double threshold)
values - the valuesthreshold - the tie threshold.
If successive elements of the sorted array differ by less than the threshold, they are treated as equal.
We count the number of ties in each group.public Rank(double[] arr)
arr - the values| Method Detail |
|---|
public double rank(int i)
arr[i].
i - index to arr
arr[i]public double[] ranks()
int[] rank
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||