# HG changeset patch # User Rik # Date 1301776672 25200 # Node ID 6ef23b4a34026cf72145ae20a7b7474c91c3f013 # Parent b22816427ce92ae94439e0e42e7ca4c1cee26e48 Add quantile, prctile functions to documentation. diff -r b22816427ce9 -r 6ef23b4a3402 doc/ChangeLog --- a/doc/ChangeLog Sat Apr 02 12:41:16 2011 -0700 +++ b/doc/ChangeLog Sat Apr 02 13:37:52 2011 -0700 @@ -1,3 +1,8 @@ +2011-04-02 Rik + + * interpreter/stats.txi: Add quantile, prctile functions to + documentation. + 2011-04-02 Rik * interpreter/system.txi: Add isdeployed function to documentation. diff -r b22816427ce9 -r 6ef23b4a3402 doc/interpreter/stats.txi --- a/doc/interpreter/stats.txi Sat Apr 02 12:41:16 2011 -0700 +++ b/doc/interpreter/stats.txi Sat Apr 02 13:37:52 2011 -0700 @@ -96,6 +96,10 @@ @DOCSTRING(moment) +@DOCSTRING(quantile) + +@DOCSTRING(prctile) + A summary view of a data set can be generated quickly with the @code{statistics} function. diff -r b22816427ce9 -r 6ef23b4a3402 scripts/ChangeLog --- a/scripts/ChangeLog Sat Apr 02 12:41:16 2011 -0700 +++ b/scripts/ChangeLog Sat Apr 02 13:37:52 2011 -0700 @@ -1,3 +1,8 @@ +2011-04-02 Rik + + * statistics/base/prctile.m, statistics/base/quantile.m: Improve + docstrings. + 2011-03-31 Rik * pkg/module.mk, pkg/pkg.m, pkg/private/get_forge_pkg.m: Add diff -r b22816427ce9 -r 6ef23b4a3402 scripts/statistics/base/prctile.m --- a/scripts/statistics/base/prctile.m Sat Apr 02 12:41:16 2011 -0700 +++ b/scripts/statistics/base/prctile.m Sat Apr 02 13:37:52 2011 -0700 @@ -17,9 +17,10 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {@var{y} =} prctile (@var{x}, @var{p}) +## @deftypefn {Function File} {@var{q} =} prctile (@var{x}) +## @deftypefnx {Function File} {@var{q} =} prctile (@var{x}, @var{p}) ## @deftypefnx {Function File} {@var{q} =} prctile (@var{x}, @var{p}, @var{dim}) -## For a sample @var{x}, compute the quantiles, @var{y}, corresponding +## For a sample @var{x}, compute the quantiles, @var{q}, corresponding ## to the cumulative probability values, @var{p}, in percent. All non-numeric ## values (NaNs) of @var{x} are ignored. ## @@ -27,6 +28,7 @@ ## return them in a matrix, such that the i-th row of @var{y} contains the ## @var{p}(i)th percentiles of each column of @var{x}. ## +## If @var{p} is unspecified, return the quantiles for @code{[0 25 50 75 100]}. ## The optional argument @var{dim} determines the dimension along which ## the percentiles are calculated. If @var{dim} is omitted, and @var{x} is ## a vector or matrix, it defaults to 1 (column-wise quantiles). When diff -r b22816427ce9 -r 6ef23b4a3402 scripts/statistics/base/quantile.m --- a/scripts/statistics/base/quantile.m Sat Apr 02 12:41:16 2011 -0700 +++ b/scripts/statistics/base/quantile.m Sat Apr 02 13:37:52 2011 -0700 @@ -87,6 +87,16 @@ ## @item R: A Language and Environment for Statistical Computing; ## @url{http://cran.r-project.org/doc/manuals/fullrefman.pdf}. ## @end itemize +## +## Examples: +## +## @example +## @group +## x = randi (1000, [10, 1]); # Create random empirical data in range 1-1000 +## q = quantile (x, [0, 1]); # Return minimum, maximum of empirical distribution +## q = quantile (x, [0.25 0.5 0.75]); # Return quartiles of empirical distribution +## @end group +## @end example ## @seealso{prctile} ## @end deftypefn