--- /usr/share/octave/3.2.4/m/statistics/base/ranks.m 2010-10-25 16:57:01.000000000 -0400 +++ ./ranksoctavemy.m 2012-05-02 00:26:34.000000000 -0400 @@ -1,45 +1,58 @@ ## Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2004, 2005, 2006, -## 2007, 2008, 2009 Kurt Hornik +## 2007, 2008, 2009 Kurt Hornik +## Copyright (C) 2012 Dave Goel ## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at +## under the terms of the GNU General Public License as published by the +## Free Software Foundation; either version 3 of the License, or (at ## your option) any later version. ## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. +## Octave is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +## for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## . - +## ## -*- texinfo -*- -## @deftypefn {Function File} {} ranks (@var{x}, @var{dim}) -## Return the ranks of @var{x} along the first non-singleton dimension -## adjust for ties. If the optional argument @var{dim} is -## given, operate along this dimension. -## @end deftypefn +## +## @deftypefn {Function File} {} ranks (@var{x}, @var{dim}) Return the +## ranks of @var{x} along the first non-singleton dimension adjust for +## ties. If the optional argument @var{dim} is given, operate along this +## dimension. Third argument @var{rtype} donates the type of ranking: 0 +## or "fractional" for fractional, which is the default, 1 or +## "competition" for competiton ranking, 2 or "modified" for modified +## competition ranking, 3 or "ordinal" for ordinal ranking and 4 or +## "dense" for dense ranking. When using the third argument, you can +## supply us '' for @var{dim} to have it auto-computed. @end deftypefn + +## This function should return a result identical to GNU OCTAVE's +## built-in rank function but is much faster (2.2s vs. 50s when the +## input was, for example, 10*rand(100123,100)). +## Additionally, we also handle several ranking schemes. -## Author: KH +## Authors: KH , Dave Goel