Code covered by the BSD License
12 Jan 2012
14 Jan 2012)
Like MATLAB's tiedrank function, but works along dimension dim of ND-array.
Watch this File
r = tiedrank_(X,dim)
[X] is a multidimensional array.
[dim] specifies which dimension to perform ranking on.
[r] ranked values of X along dimension dim. Where values are the same the mean rank is
given (e.g. [99 110 50 13 99] goes to [ 3.5 5 2 1 3.5] )
Code is fully vectorised.
-- DM, Jan 2012
Very useful indeed! Thank you for that.
Corrected line 16, now reads:
otherDims = 1:length(size(X));
Did a couple of optimising tweaks.