comparison scripts/statistics/base/prctile.m @ 12569:6ef23b4a3402

Add quantile, prctile functions to documentation.
author Rik <octave@nomad.inbox5.com>
date Sat, 02 Apr 2011 13:37:52 -0700
parents c792872f8942
children f96b9b9f141b
comparison
equal deleted inserted replaced
12568:b22816427ce9 12569:6ef23b4a3402
15 ## You should have received a copy of the GNU General Public License 15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see 16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>. 17 ## <http://www.gnu.org/licenses/>.
18 18
19 ## -*- texinfo -*- 19 ## -*- texinfo -*-
20 ## @deftypefn {Function File} {@var{y} =} prctile (@var{x}, @var{p}) 20 ## @deftypefn {Function File} {@var{q} =} prctile (@var{x})
21 ## @deftypefnx {Function File} {@var{q} =} prctile (@var{x}, @var{p})
21 ## @deftypefnx {Function File} {@var{q} =} prctile (@var{x}, @var{p}, @var{dim}) 22 ## @deftypefnx {Function File} {@var{q} =} prctile (@var{x}, @var{p}, @var{dim})
22 ## For a sample @var{x}, compute the quantiles, @var{y}, corresponding 23 ## For a sample @var{x}, compute the quantiles, @var{q}, corresponding
23 ## to the cumulative probability values, @var{p}, in percent. All non-numeric 24 ## to the cumulative probability values, @var{p}, in percent. All non-numeric
24 ## values (NaNs) of @var{x} are ignored. 25 ## values (NaNs) of @var{x} are ignored.
25 ## 26 ##
26 ## If @var{x} is a matrix, compute the percentiles for each column and 27 ## If @var{x} is a matrix, compute the percentiles for each column and
27 ## return them in a matrix, such that the i-th row of @var{y} contains the 28 ## return them in a matrix, such that the i-th row of @var{y} contains the
28 ## @var{p}(i)th percentiles of each column of @var{x}. 29 ## @var{p}(i)th percentiles of each column of @var{x}.
29 ## 30 ##
31 ## If @var{p} is unspecified, return the quantiles for @code{[0 25 50 75 100]}.
30 ## The optional argument @var{dim} determines the dimension along which 32 ## The optional argument @var{dim} determines the dimension along which
31 ## the percentiles are calculated. If @var{dim} is omitted, and @var{x} is 33 ## the percentiles are calculated. If @var{dim} is omitted, and @var{x} is
32 ## a vector or matrix, it defaults to 1 (column-wise quantiles). When 34 ## a vector or matrix, it defaults to 1 (column-wise quantiles). When
33 ## @var{x} is an N-d array, @var{dim} defaults to the first non-singleton 35 ## @var{x} is an N-d array, @var{dim} defaults to the first non-singleton
34 ## dimension. 36 ## dimension.