There are 4 ranking methods in FSharp.Stats.Rank:
example = [5,3,3,4,2]
- rankFirst - when ties are present, rank them corresponding to the order of their appearance
result :int [] = [5,2,3,4,1]
- rankMin - when ties are present, their rank correspond to the rank of the first occurrence
result :float [] = [5,2,2,4,1]
- rankMax - when ties are present, their rank correspond to the rank of the last occurrence
result :float [] = [5,3,3,4,1]
- rankAvg - when ties are present, their rank correspond to the average of all tie ranks
result :float [] = [5,2.5,2.5,4,1]
-
By now, all functions except rankFirst result in float arrays. The only function where floats can occur is rankAvg. For harmonization I would suggest, that rankFirst as well should report a float array, although it would be a breaking change.
-
There seems to be an issue, that ties are not ranked correct here:
|
let minTies a _ = (float a + 1.) |
It seems the +1 increment belongs to rankMax rather than rankMin.
EDIT 01/02/22: THIS WAS A TEMPORAL LOCAL ERROR!
A fix is on the way!
There are 4 ranking methods in
FSharp.Stats.Rank:example = [5,3,3,4,2]result :int [] = [5,2,3,4,1]result :float [] = [5,2,2,4,1]result :float [] = [5,3,3,4,1]result :float [] = [5,2.5,2.5,4,1]By now, all functions except rankFirst result in float arrays. The only function where floats can occur is rankAvg. For harmonization I would suggest, that rankFirst as well should report a float array, although it would be a breaking change.
There seems to be an issue, that ties are not ranked correct here:
FSharp.Stats/src/FSharp.Stats/Rank.fs
Line 65 in 46ab30a
It seems the +1 increment belongs to rankMax rather than rankMin.
EDIT 01/02/22: THIS WAS A TEMPORAL LOCAL ERROR!
A fix is on the way!