Mercurial > hg > octave-avbm
changeset 12569:6ef23b4a3402
Add quantile, prctile functions to documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 02 Apr 2011 13:37:52 -0700 |
parents | b22816427ce9 |
children | 1a93988610a3 |
files | doc/ChangeLog doc/interpreter/stats.txi scripts/ChangeLog scripts/statistics/base/prctile.m scripts/statistics/base/quantile.m |
diffstat | 5 files changed, 28 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2011-04-02 Rik <octave@nomad.inbox5.com> + + * interpreter/stats.txi: Add quantile, prctile functions to + documentation. + 2011-04-02 Rik <octave@nomad.inbox5.com> * interpreter/system.txi: Add isdeployed function to documentation.
--- a/doc/interpreter/stats.txi +++ b/doc/interpreter/stats.txi @@ -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.
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2011-04-02 Rik <octave@nomad.inbox5.com> + + * statistics/base/prctile.m, statistics/base/quantile.m: Improve + docstrings. + 2011-03-31 Rik <octave@nomad.inbox5.com> * pkg/module.mk, pkg/pkg.m, pkg/private/get_forge_pkg.m: Add
--- a/scripts/statistics/base/prctile.m +++ b/scripts/statistics/base/prctile.m @@ -17,9 +17,10 @@ ## <http://www.gnu.org/licenses/>. ## -*- 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
--- a/scripts/statistics/base/quantile.m +++ b/scripts/statistics/base/quantile.m @@ -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