changeset 20209:d9341b422488 stable

doc: Update more docstrings to have one sentence summary as first line. Reviewed statistics/ and @ftp/ in scripts directory. * scripts/@ftp/ascii.m, scripts/@ftp/binary.m, scripts/@ftp/cd.m, scripts/@ftp/dir.m, scripts/@ftp/ftp.m, scripts/@ftp/mget.m, scripts/@ftp/mput.m, scripts/statistics/base/center.m, scripts/statistics/base/cloglog.m, scripts/statistics/base/cov.m, scripts/statistics/base/gls.m, scripts/statistics/base/histc.m, scripts/statistics/base/iqr.m, scripts/statistics/base/kendall.m, scripts/statistics/base/kurtosis.m, scripts/statistics/base/logit.m, scripts/statistics/base/lscov.m, scripts/statistics/base/mahalanobis.m, scripts/statistics/base/mean.m, scripts/statistics/base/meansq.m, scripts/statistics/base/median.m, scripts/statistics/base/mode.m, scripts/statistics/base/moment.m, scripts/statistics/base/ols.m, scripts/statistics/base/ppplot.m, scripts/statistics/base/prctile.m, scripts/statistics/base/probit.m, scripts/statistics/base/range.m, scripts/statistics/base/ranks.m, scripts/statistics/base/run_count.m, scripts/statistics/base/runlength.m, scripts/statistics/base/skewness.m, scripts/statistics/base/spearman.m, scripts/statistics/base/statistics.m, scripts/statistics/base/std.m, scripts/statistics/base/table.m, scripts/statistics/base/var.m, scripts/statistics/base/zscore.m, scripts/statistics/distributions/betainv.m, scripts/statistics/distributions/binoinv.m, scripts/statistics/distributions/binopdf.m, scripts/statistics/distributions/cauchy_cdf.m, scripts/statistics/distributions/cauchy_inv.m, scripts/statistics/distributions/cauchy_pdf.m, scripts/statistics/distributions/chi2cdf.m, scripts/statistics/distributions/chi2inv.m, scripts/statistics/distributions/chi2pdf.m, scripts/statistics/distributions/discrete_cdf.m, scripts/statistics/distributions/discrete_inv.m, scripts/statistics/distributions/discrete_pdf.m, scripts/statistics/distributions/empirical_cdf.m, scripts/statistics/distributions/empirical_inv.m, scripts/statistics/distributions/empirical_pdf.m, scripts/statistics/distributions/expcdf.m, scripts/statistics/distributions/expinv.m, scripts/statistics/distributions/exppdf.m, scripts/statistics/distributions/finv.m, scripts/statistics/distributions/fpdf.m, scripts/statistics/distributions/gamcdf.m, scripts/statistics/distributions/gaminv.m, scripts/statistics/distributions/gampdf.m, scripts/statistics/distributions/geoinv.m, scripts/statistics/distributions/geopdf.m, scripts/statistics/distributions/hygecdf.m, scripts/statistics/distributions/hygeinv.m, scripts/statistics/distributions/hygepdf.m, scripts/statistics/distributions/kolmogorov_smirnov_cdf.m, scripts/statistics/distributions/laplace_cdf.m, scripts/statistics/distributions/laplace_inv.m, scripts/statistics/distributions/laplace_pdf.m, scripts/statistics/distributions/logistic_inv.m, scripts/statistics/distributions/logncdf.m, scripts/statistics/distributions/logninv.m, scripts/statistics/distributions/lognpdf.m, scripts/statistics/distributions/nbincdf.m, scripts/statistics/distributions/nbininv.m, scripts/statistics/distributions/nbinpdf.m, scripts/statistics/distributions/nbinrnd.m, scripts/statistics/distributions/normcdf.m, scripts/statistics/distributions/norminv.m, scripts/statistics/distributions/normpdf.m, scripts/statistics/distributions/poisscdf.m, scripts/statistics/distributions/poissinv.m, scripts/statistics/distributions/poisspdf.m, scripts/statistics/distributions/stdnormal_cdf.m, scripts/statistics/distributions/stdnormal_pdf.m, scripts/statistics/distributions/tcdf.m, scripts/statistics/distributions/tinv.m, scripts/statistics/distributions/tpdf.m, scripts/statistics/distributions/unidcdf.m, scripts/statistics/distributions/unidinv.m, scripts/statistics/distributions/unidpdf.m, scripts/statistics/distributions/unidrnd.m, scripts/statistics/distributions/unifcdf.m, scripts/statistics/distributions/unifinv.m, scripts/statistics/distributions/wblcdf.m, scripts/statistics/distributions/wblinv.m, scripts/statistics/distributions/wblpdf.m, scripts/statistics/distributions/wienrnd.m, scripts/statistics/models/private/logistic_regression_derivatives.m, scripts/statistics/models/private/logistic_regression_likelihood.m, scripts/statistics/tests/anova.m, scripts/statistics/tests/chisquare_test_homogeneity.m, scripts/statistics/tests/chisquare_test_independence.m, scripts/statistics/tests/cor_test.m, scripts/statistics/tests/f_test_regression.m, scripts/statistics/tests/hotelling_test.m, scripts/statistics/tests/kolmogorov_smirnov_test.m, scripts/statistics/tests/kolmogorov_smirnov_test_2.m, scripts/statistics/tests/kruskal_wallis_test.m, scripts/statistics/tests/manova.m, scripts/statistics/tests/mcnemar_test.m, scripts/statistics/tests/prop_test_2.m, scripts/statistics/tests/run_test.m, scripts/statistics/tests/sign_test.m, scripts/statistics/tests/t_test.m, scripts/statistics/tests/t_test_2.m, scripts/statistics/tests/t_test_regression.m, scripts/statistics/tests/u_test.m, scripts/statistics/tests/var_test.m, scripts/statistics/tests/welch_test.m, scripts/statistics/tests/wilcoxon_test.m, scripts/statistics/tests/z_test.m, scripts/statistics/tests/z_test_2.m: Update more docstrings to have one sentence summary as first line.
author Rik <rik@octave.org>
date Sun, 10 May 2015 16:07:41 -0700
parents 777f26aa8e3e
children 014edaafa3ad
files scripts/@ftp/ascii.m scripts/@ftp/binary.m scripts/@ftp/cd.m scripts/@ftp/dir.m scripts/@ftp/ftp.m scripts/@ftp/mget.m scripts/@ftp/mput.m scripts/statistics/base/center.m scripts/statistics/base/cloglog.m scripts/statistics/base/cov.m scripts/statistics/base/gls.m scripts/statistics/base/histc.m scripts/statistics/base/iqr.m scripts/statistics/base/kendall.m scripts/statistics/base/kurtosis.m scripts/statistics/base/logit.m scripts/statistics/base/lscov.m scripts/statistics/base/mahalanobis.m scripts/statistics/base/mean.m scripts/statistics/base/meansq.m scripts/statistics/base/median.m scripts/statistics/base/mode.m scripts/statistics/base/moment.m scripts/statistics/base/ols.m scripts/statistics/base/ppplot.m scripts/statistics/base/prctile.m scripts/statistics/base/probit.m scripts/statistics/base/range.m scripts/statistics/base/ranks.m scripts/statistics/base/run_count.m scripts/statistics/base/runlength.m scripts/statistics/base/skewness.m scripts/statistics/base/spearman.m scripts/statistics/base/statistics.m scripts/statistics/base/std.m scripts/statistics/base/table.m scripts/statistics/base/var.m scripts/statistics/base/zscore.m scripts/statistics/distributions/betainv.m scripts/statistics/distributions/binoinv.m scripts/statistics/distributions/binopdf.m scripts/statistics/distributions/cauchy_cdf.m scripts/statistics/distributions/cauchy_inv.m scripts/statistics/distributions/cauchy_pdf.m scripts/statistics/distributions/chi2cdf.m scripts/statistics/distributions/chi2inv.m scripts/statistics/distributions/chi2pdf.m scripts/statistics/distributions/discrete_cdf.m scripts/statistics/distributions/discrete_inv.m scripts/statistics/distributions/discrete_pdf.m scripts/statistics/distributions/empirical_cdf.m scripts/statistics/distributions/empirical_inv.m scripts/statistics/distributions/empirical_pdf.m scripts/statistics/distributions/expcdf.m scripts/statistics/distributions/expinv.m scripts/statistics/distributions/exppdf.m scripts/statistics/distributions/finv.m scripts/statistics/distributions/fpdf.m scripts/statistics/distributions/gamcdf.m scripts/statistics/distributions/gaminv.m scripts/statistics/distributions/gampdf.m scripts/statistics/distributions/geoinv.m scripts/statistics/distributions/geopdf.m scripts/statistics/distributions/hygecdf.m scripts/statistics/distributions/hygeinv.m scripts/statistics/distributions/hygepdf.m scripts/statistics/distributions/kolmogorov_smirnov_cdf.m scripts/statistics/distributions/laplace_cdf.m scripts/statistics/distributions/laplace_inv.m scripts/statistics/distributions/laplace_pdf.m scripts/statistics/distributions/logistic_inv.m scripts/statistics/distributions/logncdf.m scripts/statistics/distributions/logninv.m scripts/statistics/distributions/lognpdf.m scripts/statistics/distributions/nbincdf.m scripts/statistics/distributions/nbininv.m scripts/statistics/distributions/nbinpdf.m scripts/statistics/distributions/nbinrnd.m scripts/statistics/distributions/normcdf.m scripts/statistics/distributions/norminv.m scripts/statistics/distributions/normpdf.m scripts/statistics/distributions/poisscdf.m scripts/statistics/distributions/poissinv.m scripts/statistics/distributions/poisspdf.m scripts/statistics/distributions/stdnormal_cdf.m scripts/statistics/distributions/stdnormal_pdf.m scripts/statistics/distributions/tcdf.m scripts/statistics/distributions/tinv.m scripts/statistics/distributions/tpdf.m scripts/statistics/distributions/unidcdf.m scripts/statistics/distributions/unidinv.m scripts/statistics/distributions/unidpdf.m scripts/statistics/distributions/unidrnd.m scripts/statistics/distributions/unifcdf.m scripts/statistics/distributions/unifinv.m scripts/statistics/distributions/wblcdf.m scripts/statistics/distributions/wblinv.m scripts/statistics/distributions/wblpdf.m scripts/statistics/distributions/wienrnd.m scripts/statistics/models/private/logistic_regression_derivatives.m scripts/statistics/models/private/logistic_regression_likelihood.m scripts/statistics/tests/anova.m scripts/statistics/tests/chisquare_test_homogeneity.m scripts/statistics/tests/chisquare_test_independence.m scripts/statistics/tests/cor_test.m scripts/statistics/tests/f_test_regression.m scripts/statistics/tests/hotelling_test.m scripts/statistics/tests/kolmogorov_smirnov_test.m scripts/statistics/tests/kolmogorov_smirnov_test_2.m scripts/statistics/tests/kruskal_wallis_test.m scripts/statistics/tests/manova.m scripts/statistics/tests/mcnemar_test.m scripts/statistics/tests/prop_test_2.m scripts/statistics/tests/run_test.m scripts/statistics/tests/sign_test.m scripts/statistics/tests/t_test.m scripts/statistics/tests/t_test_2.m scripts/statistics/tests/t_test_regression.m scripts/statistics/tests/u_test.m scripts/statistics/tests/var_test.m scripts/statistics/tests/welch_test.m scripts/statistics/tests/wilcoxon_test.m scripts/statistics/tests/z_test.m scripts/statistics/tests/z_test_2.m
diffstat 124 files changed, 607 insertions(+), 521 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/@ftp/ascii.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/@ftp/ascii.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,9 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} ascii (@var{f})
 ## Set the FTP connection @var{f} to use ASCII mode for transfers.
-## ASCII mode is only appropriate for text files as it will convert
-## the remote host's newline representation to the local host's newline
+##
+## ASCII mode is only appropriate for text files as it will convert the
+## remote host's newline representation to the local host's newline
 ## representation.
 ##
 ## @var{f} is an FTP object returned by the @code{ftp} function.
--- a/scripts/@ftp/binary.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/@ftp/binary.m	Sun May 10 16:07:41 2015 -0700
@@ -19,6 +19,7 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} binary (@var{f})
 ## Set the FTP connection @var{f} to use binary mode for transfers.
+##
 ## In binary mode there is no conversion of newlines from the remote
 ## representation to the local representation.
 ##
--- a/scripts/@ftp/cd.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/@ftp/cd.m	Sun May 10 16:07:41 2015 -0700
@@ -24,8 +24,8 @@
 ## @var{f} is an FTP object returned by the @code{ftp} function.
 ##
 ## If @var{path} is not specified, return the remote current working
-## directory.  Otherwise, set the remote directory to @var{path} and
-## return the new remote working directory.
+## directory.  Otherwise, set the remote directory to @var{path} and return
+## the new remote working directory.
 ##
 ## If the directory does not exist, an error message is printed and the
 ## working directory is not changed.
--- a/scripts/@ftp/dir.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/@ftp/dir.m	Sun May 10 16:07:41 2015 -0700
@@ -18,8 +18,7 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {@var{lst} =} dir (@var{f})
-## List the current directory in verbose form for the FTP connection
-## @var{f}.
+## List the current directory in verbose form for the FTP connection @var{f}.
 ##
 ## @var{f} is an FTP object returned by the @code{ftp} function.
 ## @end deftypefn
--- a/scripts/@ftp/ftp.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/@ftp/ftp.m	Sun May 10 16:07:41 2015 -0700
@@ -20,6 +20,7 @@
 ## @deftypefn  {Function File} {@var{f} =} ftp (@var{host})
 ## @deftypefnx {Function File} {@var{f} =} ftp (@var{host}, @var{username}, @var{password})
 ## Connect to the FTP server @var{host} with @var{username} and @var{password}.
+##
 ## If @var{username} and @var{password} are not specified, user
 ## @qcode{"anonymous"} with no password is used.  The returned FTP object
 ## @var{f} represents the established FTP connection.
--- a/scripts/@ftp/mget.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/@ftp/mget.m	Sun May 10 16:07:41 2015 -0700
@@ -21,8 +21,9 @@
 ## @deftypefnx {Function File} {} mget (@var{f}, @var{dir})
 ## @deftypefnx {Function File} {} mget (@var{f}, @var{remote_name}, @var{target})
 ## Download a remote file @var{file} or directory @var{dir} to the local
-## directory on the FTP connection @var{f}.  @var{f} is an FTP object
-## returned by the @code{ftp} function.
+## directory on the FTP connection @var{f}.
+##
+## @var{f} is an FTP object returned by the @code{ftp} function.
 ##
 ## The arguments @var{file} and @var{dir} can include wildcards and any
 ## files or directories on the remote server that match will be downloaded.
--- a/scripts/@ftp/mput.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/@ftp/mput.m	Sun May 10 16:07:41 2015 -0700
@@ -18,9 +18,10 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} mput (@var{f}, @var{file})
-## Upload the local file @var{file} into the current remote directory on
-## the FTP connection @var{f}.  @var{f} is an FTP object returned by the
-## ftp function.
+## Upload the local file @var{file} into the current remote directory on the
+## FTP connection @var{f}.
+##
+## @var{f} is an FTP object returned by the ftp function.
 ##
 ## The argument @var{file} is passed through the @code{glob} function and any
 ## files that match the wildcards in @var{file} will be uploaded.
--- a/scripts/statistics/base/center.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/center.m	Sun May 10 16:07:41 2015 -0700
@@ -20,9 +20,19 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} center (@var{x})
 ## @deftypefnx {Function File} {} center (@var{x}, @var{dim})
+## Center data by subtracting its mean.
+##
 ## If @var{x} is a vector, subtract its mean.
+##
 ## If @var{x} is a matrix, do the above for each column.
+##
 ## If the optional argument @var{dim} is given, operate along this dimension.
+##
+## Programming Note: @code{center} has obvious application for normalizing
+## statistical data.  It is also useful for improving the precision of general
+## numerical calculations.  Whenever there is a large value that is common
+## to a batch of data, the mean can be subtracted off, the calculation
+## performed, and then the mean added back to obtain the final answer.
 ## @seealso{zscore}
 ## @end deftypefn
 
--- a/scripts/statistics/base/cloglog.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/cloglog.m	Sun May 10 16:07:41 2015 -0700
@@ -18,7 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} cloglog (@var{x})
-## Return the complementary log-log function of @var{x}, defined as
+## Return the complementary log-log function of @var{x}.
+##
+## The complementary log-log function is defined as
 ## @tex
 ## $$
 ## {\rm cloglog}(x) = - \log (- \log (x))
--- a/scripts/statistics/base/cov.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/cov.m	Sun May 10 16:07:41 2015 -0700
@@ -56,7 +56,7 @@
 ##   normalize with @math{N}, this provides the second moment around the mean
 ## @end table
 ##
-## @sc{matlab} compatibility: Octave always computes the covariance matrix.
+## Compatibility Note:: Octave always computes the covariance matrix.
 ## For two inputs, however, @sc{matlab} will calculate
 ## @code{cov (@var{x}(:), @var{y}(:))} whenever the number of elements in
 ## @var{x} and @var{y} are equal.  This will result in a scalar rather than
--- a/scripts/statistics/base/gls.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/gls.m	Sun May 10 16:07:41 2015 -0700
@@ -18,7 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{beta}, @var{v}, @var{r}] =} gls (@var{y}, @var{x}, @var{o})
-## Generalized least squares estimation for the multivariate model
+## Generalized least squares model.
+##
+## Perform a generalized least squares estimation for the multivariate model
 ## @tex
 ## $y = x b + e$
 ## with $\bar{e} = 0$ and cov(vec($e$)) = $(s^2)o$,
--- a/scripts/statistics/base/histc.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/histc.m	Sun May 10 16:07:41 2015 -0700
@@ -21,7 +21,7 @@
 ## @deftypefn  {Function File} {@var{n} =} histc (@var{x}, @var{edges})
 ## @deftypefnx {Function File} {@var{n} =} histc (@var{x}, @var{edges}, @var{dim})
 ## @deftypefnx {Function File} {[@var{n}, @var{idx}] =} histc (@dots{})
-## Produce histogram counts.
+## Compute histogram counts.
 ##
 ## When @var{x} is a vector, the function counts the number of elements of
 ## @var{x} that fall in the histogram bins defined by @var{edges}.  This must be
@@ -31,9 +31,9 @@
 ## The final element of @var{n} contains the number of elements of @var{x}
 ## exactly equal to the last element of @var{edges}.
 ##
-## When @var{x} is an @math{N}-dimensional array, the computation is
-## carried out along dimension @var{dim}.  If not specified @var{dim} defaults
-## to the first non-singleton dimension.
+## When @var{x} is an @math{N}-dimensional array, the computation is carried
+## out along dimension @var{dim}.  If not specified @var{dim} defaults to the
+## first non-singleton dimension.
 ##
 ## When a second output argument is requested an index matrix is also returned.
 ## The @var{idx} matrix has the same size as @var{x}.  Each element of @var{idx}
--- a/scripts/statistics/base/iqr.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/iqr.m	Sun May 10 16:07:41 2015 -0700
@@ -20,8 +20,10 @@
 ## @deftypefn  {Function File} {} iqr (@var{x})
 ## @deftypefnx {Function File} {} iqr (@var{x}, @var{dim})
 ## Return the interquartile range, i.e., the difference between the upper
-## and lower quartile of the input data.  If @var{x} is a matrix, do the
-## above for first non-singleton dimension of @var{x}.
+## and lower quartile of the input data.
+##
+## If @var{x} is a matrix, do the above for first non-singleton dimension of
+## @var{x}.
 ##
 ## If the optional argument @var{dim} is given, operate along this dimension.
 ##
--- a/scripts/statistics/base/kendall.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/kendall.m	Sun May 10 16:07:41 2015 -0700
@@ -22,10 +22,10 @@
 ## @cindex Kendall's Tau
 ## Compute Kendall's @var{tau}.
 ##
-## For two data vectors @var{x}, @var{y} of common length @var{n},
-## Kendall's @var{tau} is the correlation of the signs of all rank
-## differences of @var{x} and @var{y}; i.e., if both @var{x} and
-## @var{y} have distinct entries, then
+## For two data vectors @var{x}, @var{y} of common length @var{n}, Kendall's
+## @var{tau} is the correlation of the signs of all rank differences of
+## @var{x} and @var{y}; i.e., if both @var{x} and @var{y} have distinct
+## entries, then
 ##
 ## @tex
 ## $$ \tau = {1 \over n(n-1)} \sum_{i,j} {\rm sign}(q_i-q_j) {\rm sign}(r_i-r_j) $$
--- a/scripts/statistics/base/kurtosis.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/kurtosis.m	Sun May 10 16:07:41 2015 -0700
@@ -21,7 +21,9 @@
 ## @deftypefn  {Function File} {} kurtosis (@var{x})
 ## @deftypefnx {Function File} {} kurtosis (@var{x}, @var{flag})
 ## @deftypefnx {Function File} {} kurtosis (@var{x}, @var{flag}, @var{dim})
-## Compute the sample kurtosis of the elements of @var{x}:
+## Compute the sample kurtosis of the elements of @var{x}.
+##
+## The sample kurtosis is defined as
 ## @tex
 ## $$
 ## \kappa_1 = {{{1\over N}\,
--- a/scripts/statistics/base/logit.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/logit.m	Sun May 10 16:07:41 2015 -0700
@@ -18,7 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} logit (@var{p})
-## For each component of @var{p}, return the logit of @var{p} defined as
+## Compute the logit for each value of @var{p}
+##
+## The logit is defined as
 ## @tex
 ## $$
 ## {\rm logit}(p) = \log\Big({p \over 1-p}\Big)
@@ -31,7 +33,7 @@
 ## @end example
 ##
 ## @end ifnottex
-## @seealso{logistic_cdf}
+## @seealso{probit, logistic_cdf}
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/base/lscov.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/lscov.m	Sun May 10 16:07:41 2015 -0700
@@ -20,6 +20,7 @@
 ## @deftypefnx {Function File} {[@var{x}, @var{stdx}, @var{mse}, @var{S}] =} lscov (@dots{})
 ##
 ## Compute a generalized linear least squares fit.
+##
 ## Estimate @var{x} under the model @var{b} = @var{A}@var{x} + @var{w},
 ## where the noise @var{w} is assumed to follow a normal distribution
 ## with covariance matrix @math{{\sigma^2} V}.
@@ -28,25 +29,24 @@
 ## size of the vector/array of constant terms @var{b} must be n-by-k.
 ##
 ## The optional input argument @var{V} may be a n-by-1 vector of positive
-## weights (inverse variances), or a n-by-n symmetric positive
-## semidefinite matrix representing the covariance of @var{b}.  If
-## @var{V} is not supplied, the ordinary least squares solution is
-## returned.
+## weights (inverse variances), or a n-by-n symmetric positive semidefinite
+## matrix representing the covariance of @var{b}.  If @var{V} is not
+## supplied, the ordinary least squares solution is returned.
 ##
-## The @var{alg} input argument, a guidance on solution method to use,
-## is currently ignored.
+## The @var{alg} input argument, a guidance on solution method to use, is
+## currently ignored.
 ##
-## Besides the least-squares estimate matrix @var{x} (p-by-k), the
-## function also returns @var{stdx} (p-by-k), the error standard
-## deviation of estimated @var{x}; @var{mse} (k-by-1), the estimated
-## data error covariance scale factors (@math{\sigma^2}); and @var{S}
-## (p-by-p, or p-by-p-by-k if k > 1), the error covariance of @var{x}.
+## Besides the least-squares estimate matrix @var{x} (p-by-k), the function
+## also returns @var{stdx} (p-by-k), the error standard deviation of
+## estimated @var{x}; @var{mse} (k-by-1), the estimated data error covariance
+## scale factors (@math{\sigma^2}); and @var{S} (p-by-p, or p-by-p-by-k if k
+## > 1), the error covariance of @var{x}.
 ##
 ## Reference: @nospell{Golub and Van Loan} (1996),
-## Matrix Computations (3rd Ed.), Johns Hopkins, Section 5.6.3
+## @cite{Matrix Computations (3rd Ed.)}, Johns Hopkins, Section 5.6.3
 ##
+## @seealso{ols, gls, lsqnonneg}
 ## @end deftypefn
-## @seealso{ols, gls, lsqnonneg}
 
 ## Author: Nir Krakauer
 
--- a/scripts/statistics/base/mahalanobis.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/mahalanobis.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,10 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} mahalanobis (@var{x}, @var{y})
 ## Return the Mahalanobis' D-square distance between the multivariate
-## samples @var{x} and @var{y}, which must have the same number of
-## components (columns), but may have a different number of observations
-## (rows).
+## samples @var{x} and @var{y}.
+##
+## The data @var{x} and @var{y} must have the same number of components
+## (columns), but may have a different number of observations (rows).
 ## @end deftypefn
 
 ## Author: Friedrich Leisch <leisch@ci.tuwien.ac.at>
--- a/scripts/statistics/base/mean.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/mean.m	Sun May 10 16:07:41 2015 -0700
@@ -22,6 +22,9 @@
 ## @deftypefnx {Function File} {} mean (@var{x}, @var{opt})
 ## @deftypefnx {Function File} {} mean (@var{x}, @var{dim}, @var{opt})
 ## Compute the mean of the elements of the vector @var{x}.
+##
+## The mean is defined as
+##
 ## @tex
 ## $$ {\rm mean}(x) = \bar{x} = {1\over N} \sum_{i=1}^N x_i $$
 ## @end tex
@@ -35,6 +38,8 @@
 ## If @var{x} is a matrix, compute the mean for each column and return them
 ## in a row vector.
 ##
+## If the optional argument @var{dim} is given, operate along this dimension.
+##
 ## The optional argument @var{opt} selects the type of mean to compute.
 ## The following options are recognized:
 ##
@@ -49,10 +54,8 @@
 ## Compute the harmonic mean.
 ## @end table
 ##
-## If the optional argument @var{dim} is given, operate along this dimension.
-##
-## Both @var{dim} and @var{opt} are optional.  If both are supplied,
-## either may appear first.
+## Both @var{dim} and @var{opt} are optional.  If both are supplied, either
+## may appear first.
 ## @seealso{median, mode}
 ## @end deftypefn
 
--- a/scripts/statistics/base/meansq.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/meansq.m	Sun May 10 16:07:41 2015 -0700
@@ -21,6 +21,8 @@
 ## @deftypefn  {Function File} {} meansq (@var{x})
 ## @deftypefnx {Function File} {} meansq (@var{x}, @var{dim})
 ## Compute the mean square of the elements of the vector @var{x}.
+##
+## The mean square is defined as
 ## @tex
 ## $$
 ## {\rm meansq} (x) = {\sum_{i=1}^N {x_i}^2 \over N}
--- a/scripts/statistics/base/median.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/median.m	Sun May 10 16:07:41 2015 -0700
@@ -21,8 +21,8 @@
 ## @deftypefn  {Function File} {} median (@var{x})
 ## @deftypefnx {Function File} {} median (@var{x}, @var{dim})
 ## Compute the median value of the elements of the vector @var{x}.
-## If the elements of @var{x} are sorted, the median is defined
-## as
+##
+## When the elements of @var{x} are sorted, the median is defined as
 ## @tex
 ## $$
 ## {\rm median} (x) =
@@ -41,9 +41,10 @@
 ## @end example
 ##
 ## @end ifnottex
-## If @var{x} is a matrix, compute the median value for each
-## column and return them in a row vector.  If the optional @var{dim}
-## argument is given, operate along this dimension.
+## If @var{x} is a matrix, compute the median value for each column and
+## return them in a row vector.
+##
+## If the optional @var{dim} argument is given, operate along this dimension.
 ## @seealso{mean, mode}
 ## @end deftypefn
 
--- a/scripts/statistics/base/mode.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/mode.m	Sun May 10 16:07:41 2015 -0700
@@ -21,6 +21,7 @@
 ## @deftypefnx {Function File} {} mode (@var{x}, @var{dim})
 ## @deftypefnx {Function File} {[@var{m}, @var{f}, @var{c}] =} mode (@dots{})
 ## Compute the most frequently occurring value in a dataset (mode).
+##
 ## @code{mode} determines the frequency of values along the first non-singleton
 ## dimension and returns the value with the highest frequency.  If two, or
 ## more, values have the same frequency @code{mode} returns the smallest.
@@ -28,8 +29,10 @@
 ## If the optional argument @var{dim} is given, operate along this dimension.
 ##
 ## The return variable @var{f} is the number of occurrences of the mode in
-## in the dataset.  The cell array @var{c} contains all of the elements
-## with the maximum frequency.
+## the dataset.
+##
+## The cell array @var{c} contains all of the elements with the maximum
+## frequency.
 ## @seealso{mean, median}
 ## @end deftypefn
 
--- a/scripts/statistics/base/moment.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/moment.m	Sun May 10 16:07:41 2015 -0700
@@ -42,6 +42,8 @@
 ## If @var{x} is a matrix, return the row vector containing the @var{p}-th
 ## central moment of each column.
 ##
+## If the optional argument @var{dim} is given, operate along this dimension.
+##
 ## The optional string @var{type} specifies the type of moment to be computed.
 ## Valid options are:
 ##
@@ -104,8 +106,6 @@
 ## @end ifnottex
 ## @end table
 ##
-## If the optional argument @var{dim} is given, operate along this dimension.
-##
 ## If both @var{type} and @var{dim} are given they may appear in any order.
 ## @seealso{var, skewness, kurtosis}
 ## @end deftypefn
--- a/scripts/statistics/base/ols.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/ols.m	Sun May 10 16:07:41 2015 -0700
@@ -18,7 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{beta}, @var{sigma}, @var{r}] =} ols (@var{y}, @var{x})
-## Ordinary least squares estimation for the multivariate model
+## Ordinary least squares estimation.
+##
+## OLS applies to the multivariate model
 ## @tex
 ## $y = x b + e$
 ## with
@@ -34,13 +36,12 @@
 ## $b$ is a $k \times p$ matrix, and $e$ is a $t \times p$ matrix.
 ## @end tex
 ## @ifnottex
-## @math{y} is a @math{t} by @math{p} matrix, @math{x} is a @math{t} by
-## @math{k} matrix, @math{b} is a @math{k} by @math{p} matrix, and
-## @math{e} is a @math{t} by @math{p} matrix.
+## @math{y} is a @math{t} by @math{p} matrix, @math{x} is a @math{t} by @math{k}
+## matrix, @math{b} is a @math{k} by @math{p} matrix, and @math{e} is a
+## @math{t} by @math{p} matrix.
 ## @end ifnottex
 ##
-## Each row of @var{y} and @var{x} is an observation and each column a
-## variable.
+## Each row of @var{y} and @var{x} is an observation and each column a variable.
 ##
 ## The return values @var{beta}, @var{sigma}, and @var{r} are defined as
 ## follows.
--- a/scripts/statistics/base/ppplot.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/ppplot.m	Sun May 10 16:07:41 2015 -0700
@@ -21,26 +21,29 @@
 ## Perform a PP-plot (probability plot).
 ##
 ## If F is the CDF of the distribution @var{dist} with parameters
-## @var{params} and @var{x} a sample vector of length @var{n}, the
-## PP-plot graphs ordinate @var{y}(@var{i}) = F (@var{i}-th largest
-## element of @var{x}) versus abscissa @var{p}(@var{i}) = (@var{i} -
-## 0.5)/@var{n}.  If the sample comes from F, the pairs will
-## approximately follow a straight line.
+## @var{params} and @var{x} a sample vector of length @var{n}, the PP-plot
+## graphs ordinate @var{y}(@var{i}) = F (@var{i}-th largest element of
+## @var{x}) versus abscissa @var{p}(@var{i}) = (@var{i} - 0.5)/@var{n}.  If
+## the sample comes from F, the pairs will approximately follow a straight
+## line.
 ##
-## The default for @var{dist} is the standard normal distribution.  The
-## optional argument @var{params} contains a list of parameters of
-## @var{dist}.  For example, for a probability plot of the uniform
-## distribution on [2,4] and @var{x}, use
+## The default for @var{dist} is the standard normal distribution.
+##
+## The optional argument @var{params} contains a list of parameters of
+## @var{dist}.
+##
+## For example, for a probability plot of the uniform distribution on [2,4]
+## and @var{x}, use
 ##
 ## @example
 ## ppplot (x, "uniform", 2, 4)
 ## @end example
 ##
 ## @noindent
-## @var{dist} can be any string for which a function @var{dist_cdf}
-## that calculates the CDF of distribution @var{dist} exists.
+## @var{dist} can be any string for which a function @var{dist_cdf} that
+## calculates the CDF of distribution @var{dist} exists.
 ##
-## If no output arguments are given, the data are plotted directly.
+## If no output is requested then the data are plotted immediately.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/base/prctile.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/prctile.m	Sun May 10 16:07:41 2015 -0700
@@ -21,17 +21,19 @@
 ## @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{q}, corresponding
-## to the cumulative probability values, @var{p}, in percent.  All non-numeric
-## values (NaNs) of @var{x} are ignored.
+## to the cumulative probability values, @var{p}, in percent.
 ##
-## If @var{x} is a matrix, compute the percentiles for each column and
-## return them in a matrix, such that the i-th row of @var{y} contains the
+## If @var{x} is a matrix, compute the percentiles for each column and 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 it defaults to the
-## the first non-singleton dimension.
+##
+## The optional argument @var{dim} determines the dimension along which the
+## percentiles are calculated.  If @var{dim} is omitted it defaults to the
+## first non-singleton dimension.
+##
+## Programming Note: All non-numeric values (NaNs) of @var{x} are ignored.
 ## @seealso{quantile}
 ## @end deftypefn
 
--- a/scripts/statistics/base/probit.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/probit.m	Sun May 10 16:07:41 2015 -0700
@@ -18,8 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} probit (@var{p})
-## For each component of @var{p}, return the probit (the quantile of the
-## standard normal distribution) of @var{p}.
+## Return the probit (the quantile of the standard normal distribution) for
+## each element of @var{p}.
+## @seealso{logit}
 ## @end deftypefn
 
 ## Written by KH <Kurt.Hornik@wu-wien.ac.at> on 1995/02/04
--- a/scripts/statistics/base/range.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/range.m	Sun May 10 16:07:41 2015 -0700
@@ -21,9 +21,11 @@
 ## @deftypefn  {Function File} {} range (@var{x})
 ## @deftypefnx {Function File} {} range (@var{x}, @var{dim})
 ## Return the range, i.e., the difference between the maximum and the minimum
-## of the input data.  If @var{x} is a vector, the range is calculated over
-## the elements of @var{x}.  If @var{x} is a matrix, the range is calculated
-## over each column of @var{x}.
+## of the input data.
+##
+## If @var{x} is a vector, the range is calculated over the elements of
+## @var{x}.  If @var{x} is a matrix, the range is calculated over each column
+## of @var{x}.
 ##
 ## If the optional argument @var{dim} is given, operate along this dimension.
 ##
--- a/scripts/statistics/base/ranks.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/ranks.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,9 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} ranks (@var{x}, @var{dim})
 ## Return the ranks of @var{x} along the first non-singleton dimension
-## adjusted for ties.  If the optional argument @var{dim} is
-## given, operate along this dimension.
+## adjusted for ties.
+##
+## If the optional argument @var{dim} is given, operate along this dimension.
 ## @seealso{spearman, kendall}
 ## @end deftypefn
 
--- a/scripts/statistics/base/run_count.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/run_count.m	Sun May 10 16:07:41 2015 -0700
@@ -19,12 +19,12 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} run_count (@var{x}, @var{n})
 ## @deftypefnx {Function File} {} run_count (@var{x}, @var{n}, @var{dim})
-## Count the upward runs along the first non-singleton dimension of
-## @var{x} of length 1, 2, @dots{}, @var{n}-1 and greater than or equal
-## to @var{n}.
+## Count the upward runs along the first non-singleton dimension of @var{x}
+## of length 1, 2, @dots{}, @var{n}-1 and greater than or equal to @var{n}.
 ##
-## If the optional argument @var{dim} is given then operate
-## along this dimension.
+## If the optional argument @var{dim} is given then operate along this
+## dimension.
+## @seealso{runlength}
 ## @end deftypefn
 
 ## Author: FL <Friedrich.Leisch@ci.tuwien.ac.at>
--- a/scripts/statistics/base/runlength.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/runlength.m	Sun May 10 16:07:41 2015 -0700
@@ -17,9 +17,14 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {[count, value] =} runlength (@var{x})
-## Find the lengths of all sequences of common values.  Return the
-## vector of lengths and the value that was repeated.
+## @deftypefn  {Function File} {count =} runlength (@var{x})
+## @deftypefnx {Function File} {[count, value] =} runlength (@var{x})
+## Find the lengths of all sequences of common values.
+##
+## @var{count} is a vector with the lengths of each repeated value.
+##
+## The optional output @var{value} contains the value that was repeated in
+## the sequence.
 ##
 ## @example
 ## @group
@@ -27,6 +32,7 @@
 ## @result{}  [2, 1, 3, 1, 4]
 ## @end group
 ## @end example
+## @seealso{run_count}
 ## @end deftypefn
 
 function [count, value] = runlength (x)
--- a/scripts/statistics/base/skewness.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/skewness.m	Sun May 10 16:07:41 2015 -0700
@@ -21,7 +21,9 @@
 ## @deftypefn  {Function File} {} skewness (@var{x})
 ## @deftypefnx {Function File} {} skewness (@var{x}, @var{flag})
 ## @deftypefnx {Function File} {} skewness (@var{x}, @var{flag}, @var{dim})
-## Compute the sample skewness of the elements of @var{x}:
+## Compute the sample skewness of the elements of @var{x}.
+##
+## The sample skewness is defined as
 ## @tex
 ## $$
 ## {\rm skewness} (@var{x}) = {{{1\over N}\,
--- a/scripts/statistics/base/spearman.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/spearman.m	Sun May 10 16:07:41 2015 -0700
@@ -25,12 +25,12 @@
 ## For two data vectors @var{x} and @var{y}, Spearman's @var{rho} is the
 ## correlation coefficient of the ranks of @var{x} and @var{y}.
 ##
-## If @var{x} and @var{y} are drawn from independent distributions,
-## @var{rho} has zero mean and variance @code{1 / (n - 1)}, and is
-## asymptotically normally distributed.
+## If @var{x} and @var{y} are drawn from independent distributions, @var{rho}
+## has zero mean and variance @code{1 / (n - 1)}, and is asymptotically
+## normally distributed.
 ##
-## @code{spearman (@var{x})} is equivalent to @code{spearman (@var{x},
-## @var{x})}.
+## @code{spearman (@var{x})} is equivalent to
+## @code{spearman (@var{x}, @var{x})}.
 ## @seealso{ranks, kendall}
 ## @end deftypefn
 
--- a/scripts/statistics/base/statistics.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/statistics.m	Sun May 10 16:07:41 2015 -0700
@@ -23,8 +23,9 @@
 ## maximum, mean, standard deviation, skewness, and kurtosis of the elements of
 ## the vector @var{x}.
 ##
-## If @var{x} is a matrix, calculate statistics over the first
-## non-singleton dimension.
+## If @var{x} is a matrix, calculate statistics over the first non-singleton
+## dimension.
+##
 ## If the optional argument @var{dim} is given, operate along this dimension.
 ## @seealso{min, max, median, mean, std, skewness, kurtosis}
 ## @end deftypefn
--- a/scripts/statistics/base/std.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/std.m	Sun May 10 16:07:41 2015 -0700
@@ -21,6 +21,8 @@
 ## @deftypefnx {Function File} {} std (@var{x}, @var{opt})
 ## @deftypefnx {Function File} {} std (@var{x}, @var{opt}, @var{dim})
 ## Compute the standard deviation of the elements of the vector @var{x}.
+##
+## The standard deviation is defined as
 ## @tex
 ## $$
 ## {\rm std} (x) = \sigma = \sqrt{{\sum_{i=1}^N (x_i - \bar{x})^2 \over N - 1}}
@@ -39,8 +41,8 @@
 ## where @math{N} is the number of elements.
 ## @end ifnottex
 ##
-## If @var{x} is a matrix, compute the standard deviation for
-## each column and return them in a row vector.
+## If @var{x} is a matrix, compute the standard deviation for each column and
+## return them in a row vector.
 ##
 ## The argument @var{opt} determines the type of normalization to use.
 ## Valid values are
--- a/scripts/statistics/base/table.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/table.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,9 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {[@var{t}, @var{l_x}] =} table (@var{x})
 ## @deftypefnx {Function File} {[@var{t}, @var{l_x}, @var{l_y}] =} table (@var{x}, @var{y})
-## Create a contingency table @var{t} from data vectors.  The @var{l_x} and
-## @var{l_y} vectors are the corresponding levels.
+## Create a contingency table @var{t} from data vectors.
+##
+## The @var{l_x} and @var{l_y} vectors are the corresponding levels.
 ##
 ## Currently, only 1- and 2-dimensional tables are supported.
 ## @end deftypefn
--- a/scripts/statistics/base/var.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/var.m	Sun May 10 16:07:41 2015 -0700
@@ -21,6 +21,8 @@
 ## @deftypefnx {Function File} {} var (@var{x}, @var{opt})
 ## @deftypefnx {Function File} {} var (@var{x}, @var{opt}, @var{dim})
 ## Compute the variance of the elements of the vector @var{x}.
+##
+## The variance is defined as
 ## @tex
 ## $$
 ## {\rm var} (x) = \sigma^2 = {\sum_{i=1}^N (x_i - \bar{x})^2 \over N - 1}
@@ -36,8 +38,8 @@
 ## @end example
 ##
 ## @end ifnottex
-## If @var{x} is a matrix, compute the variance for each column
-## and return them in a row vector.
+## If @var{x} is a matrix, compute the variance for each column and return
+## them in a row vector.
 ##
 ## The argument @var{opt} determines the type of normalization to use.
 ## Valid values are
@@ -51,8 +53,8 @@
 ##   normalizes with @math{N}, this provides the second moment around the mean
 ## @end table
 ##
-## If @math{N==1} the value of @var{opt} is ignored and normalization
-## by @math{N} is used.
+## If @math{N==1} the value of @var{opt} is ignored and normalization by
+## @math{N} is used.
 ##
 ## If the optional argument @var{dim} is given, operate along this dimension.
 ## @seealso{cov, std, skewness, kurtosis, moment}
--- a/scripts/statistics/base/zscore.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/base/zscore.m	Sun May 10 16:07:41 2015 -0700
@@ -17,21 +17,25 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {[@var{z}, @var{mu}, @var{sigma}] =} zscore (@var{x})
-## @deftypefnx {Function File} {[@var{z}, @var{mu}, @var{sigma}] =} zscore (@var{x}, @var{opt})
-## @deftypefnx {Function File} {[@var{z}, @var{mu}, @var{sigma}] =} zscore (@var{x}, @var{opt}, @var{dim})
+## @deftypefn  {Function File} {@var{z} =} zscore (@var{x})
+## @deftypefnx {Function File} {@var{z} =} zscore (@var{x}, @var{opt})
+## @deftypefnx {Function File} {@var{z} =} zscore (@var{x}, @var{opt}, @var{dim})
+## @deftypefnx {Function File} {[@var{z}, @var{mu}, @var{sigma}] =} zscore (@dots{})
+## Compute the Z score of @var{x}
+##
 ## If @var{x} is a vector, subtract its mean and divide by its standard
 ## deviation.  If the standard deviation is zero, divide by 1 instead.
-## The optional parameter @var{opt} determines the normalization to use
-## when computing the standard deviation and is the same as the
+##
+## The optional parameter @var{opt} determines the normalization to use when
+## computing the standard deviation and has the same definition as the
 ## corresponding parameter for @code{std}.
 ##
-## If @var{x} is a matrix, do the above along the first non-singleton
-## dimension.  If the third optional argument @var{dim} is given, operate
-## along this dimension.
+## If @var{x} is a matrix, calculate along the first non-singleton dimension.
+## If the third optional argument @var{dim} is given, operate along this
+## dimension.
 ##
-## The mean and standard deviation along @var{dim} are given in @var{mu}
-## and @var{sigma} respectively.
+## The optional outputs @var{mu} and @var{sigma} contain the mean and standard
+## deviation.
 ##
 ## @seealso{mean, std, center}
 ## @end deftypefn
--- a/scripts/statistics/distributions/betainv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/betainv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} betainv (@var{x}, @var{a}, @var{b})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the Beta distribution with parameters @var{a}
-## and @var{b}.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the Beta distribution with parameters @var{a} and @var{b}.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/binoinv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/binoinv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} binoinv (@var{x}, @var{n}, @var{p})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the binomial distribution with parameters
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the binomial distribution with parameters
 ## @var{n} and @var{p}, where @var{n} is the number of trials and
 ## @var{p} is the probability of success.
 ## @end deftypefn
--- a/scripts/statistics/distributions/binopdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/binopdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,10 +19,10 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} binopdf (@var{x}, @var{n}, @var{p})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the binomial distribution with parameters @var{n}
-## and @var{p}, where @var{n} is the number of trials and @var{p} is the
-## probability of success.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the binomial distribution with parameters @var{n} and @var{p},
+## where @var{n} is the number of trials and @var{p} is the probability of
+## success.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/cauchy_cdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/cauchy_cdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,10 +20,11 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} cauchy_cdf (@var{x})
 ## @deftypefnx {Function File} {} cauchy_cdf (@var{x}, @var{location}, @var{scale})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of the Cauchy distribution with location
-## parameter @var{location} and scale parameter @var{scale}.  Default
-## values are @var{location} = 0, @var{scale} = 1.
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of the Cauchy distribution with location parameter
+## @var{location} and scale parameter @var{scale}.
+##
+## Default values are @var{location} = 0, @var{scale} = 1.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/cauchy_inv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/cauchy_inv.m	Sun May 10 16:07:41 2015 -0700
@@ -20,10 +20,11 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} cauchy_inv (@var{x})
 ## @deftypefnx {Function File} {} cauchy_inv (@var{x}, @var{location}, @var{scale})
-## For each element of @var{x}, compute the quantile (the inverse of the
-## CDF) at @var{x} of the Cauchy distribution with location parameter
-## @var{location} and scale parameter @var{scale}.  Default values are
-## @var{location} = 0, @var{scale} = 1.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the Cauchy distribution with location parameter
+## @var{location} and scale parameter @var{scale}.
+##
+## Default values are @var{location} = 0, @var{scale} = 1.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/cauchy_pdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/cauchy_pdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,10 +20,11 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} cauchy_pdf (@var{x})
 ## @deftypefnx {Function File} {} cauchy_pdf (@var{x}, @var{location}, @var{scale})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the Cauchy distribution with location parameter
-## @var{location} and scale parameter @var{scale} > 0.  Default values are
-## @var{location} = 0, @var{scale} = 1.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the Cauchy distribution with location parameter
+## @var{location} and scale parameter @var{scale} > 0.
+##
+## Default values are @var{location} = 0, @var{scale} = 1.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/chi2cdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/chi2cdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} chi2cdf (@var{x}, @var{n})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of the chi-square distribution with @var{n}
-## degrees of freedom.
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of the chi-square distribution with @var{n} degrees of
+## freedom.
 ## @end deftypefn
 
 ## Author: TT <Teresa.Twaroch@ci.tuwien.ac.at>
--- a/scripts/statistics/distributions/chi2inv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/chi2inv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} chi2inv (@var{x}, @var{n})
-## For each element of @var{x}, compute the quantile (the inverse of the
-## CDF) at @var{x} of the chi-square distribution with @var{n} degrees of
-## freedom.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the chi-square distribution with @var{n} degrees of freedom.
 ## @end deftypefn
 
 ## Author: TT <Teresa.Twaroch@ci.tuwien.ac.at>
--- a/scripts/statistics/distributions/chi2pdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/chi2pdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} chi2pdf (@var{x}, @var{n})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the chi-square distribution with @var{n} degrees
-## of freedom.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the chi-square distribution with @var{n} degrees of freedom.
 ## @end deftypefn
 
 ## Author: TT <Teresa.Twaroch@ci.tuwien.ac.at>
--- a/scripts/statistics/distributions/discrete_cdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/discrete_cdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} discrete_cdf (@var{x}, @var{v}, @var{p})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of a univariate discrete distribution which
-## assumes the values in @var{v} with probabilities @var{p}.
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of a univariate discrete distribution which assumes the
+## values in @var{v} with probabilities @var{p}.
 ## @end deftypefn
 
 function cdf = discrete_cdf (x, v, p)
--- a/scripts/statistics/distributions/discrete_inv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/discrete_inv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} discrete_inv (@var{x}, @var{v}, @var{p})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the univariate distribution which assumes the
-## values in @var{v} with probabilities @var{p}.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the univariate distribution which assumes the values in
+## @var{v} with probabilities @var{p}.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/discrete_pdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/discrete_pdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} discrete_pdf (@var{x}, @var{v}, @var{p})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of a univariate discrete distribution which assumes
-## the values in @var{v} with probabilities @var{p}.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of a univariate discrete distribution which assumes the values
+## in @var{v} with probabilities @var{p}.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/empirical_cdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/empirical_cdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} empirical_cdf (@var{x}, @var{data})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of the empirical distribution obtained from
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of the empirical distribution obtained from
 ## the univariate sample @var{data}.
 ## @end deftypefn
 
--- a/scripts/statistics/distributions/empirical_inv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/empirical_inv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} empirical_inv (@var{x}, @var{data})
-## For each element of @var{x}, compute the quantile (the inverse of the
-## CDF) at @var{x} of the empirical distribution obtained from the
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the empirical distribution obtained from the
 ## univariate sample @var{data}.
 ## @end deftypefn
 
--- a/scripts/statistics/distributions/empirical_pdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/empirical_pdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} empirical_pdf (@var{x}, @var{data})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the empirical distribution obtained from the
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the empirical distribution obtained from the
 ## univariate sample @var{data}.
 ## @end deftypefn
 
--- a/scripts/statistics/distributions/expcdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/expcdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} expcdf (@var{x}, @var{lambda})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of the exponential distribution with
-## mean @var{lambda}.
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of the exponential distribution with mean @var{lambda}.
 ##
 ## The arguments can be of common size or scalars.
 ## @end deftypefn
--- a/scripts/statistics/distributions/expinv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/expinv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} expinv (@var{x}, @var{lambda})
-## For each element of @var{x}, compute the quantile (the inverse of the
-## CDF) at @var{x} of the exponential distribution with mean @var{lambda}.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the exponential distribution with mean @var{lambda}.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/exppdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/exppdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} exppdf (@var{x}, @var{lambda})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the exponential distribution with mean @var{lambda}.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the exponential distribution with mean @var{lambda}.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/finv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/finv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} finv (@var{x}, @var{m}, @var{n})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the F distribution with @var{m} and @var{n}
-## degrees of freedom.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the F distribution with @var{m} and @var{n} degrees of freedom.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/fpdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/fpdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} fpdf (@var{x}, @var{m}, @var{n})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the F distribution with @var{m} and @var{n}
-## degrees of freedom.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the F distribution with @var{m} and @var{n} degrees of freedom.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/gamcdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/gamcdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} gamcdf (@var{x}, @var{a}, @var{b})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of the Gamma distribution with shape
-## parameter @var{a} and scale @var{b}.
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of the Gamma distribution with shape parameter @var{a} and
+## scale @var{b}.
 ## @end deftypefn
 
 ## Author: TT <Teresa.Twaroch@ci.tuwien.ac.at>
--- a/scripts/statistics/distributions/gaminv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/gaminv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} gaminv (@var{x}, @var{a}, @var{b})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the Gamma distribution with shape parameter
-## @var{a} and scale @var{b}.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the Gamma distribution with shape parameter @var{a} and
+## scale @var{b}.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/gampdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/gampdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,8 +20,8 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} gampdf (@var{x}, @var{a}, @var{b})
 ## For each element of @var{x}, return the probability density function
-## (PDF) at @var{x} of the Gamma distribution with shape parameter
-## @var{a} and scale @var{b}.
+## (PDF) at @var{x} of the Gamma distribution with shape parameter @var{a} and
+## scale @var{b}.
 ## @end deftypefn
 
 ## Author: TT <Teresa.Twaroch@ci.tuwien.ac.at>
--- a/scripts/statistics/distributions/geoinv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/geoinv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} geoinv (@var{x}, @var{p})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the geometric distribution with parameter @var{p}.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the geometric distribution with parameter @var{p}.
 ##
 ## The geometric distribution models the number of failures (@var{x}-1) of a
 ## Bernoulli trial with probability @var{p} before the first success (@var{x}).
--- a/scripts/statistics/distributions/geopdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/geopdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} geopdf (@var{x}, @var{p})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the geometric distribution with parameter @var{p}.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the geometric distribution with parameter @var{p}.
 ##
 ## The geometric distribution models the number of failures (@var{x}-1) of a
 ## Bernoulli trial with probability @var{p} before the first success (@var{x}).
--- a/scripts/statistics/distributions/hygecdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/hygecdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,11 +20,11 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} hygecdf (@var{x}, @var{t}, @var{m}, @var{n})
 ## Compute the cumulative distribution function (CDF) at @var{x} of the
-## hypergeometric distribution with parameters @var{t}, @var{m}, and
-## @var{n}.  This is the probability of obtaining not more than @var{x}
-## marked items when randomly drawing a sample of size @var{n} without
-## replacement from a population of total size @var{t} containing
-## @var{m} marked items.
+## hypergeometric distribution with parameters @var{t}, @var{m}, and @var{n}.
+##
+## This is the probability of obtaining not more than @var{x} marked items
+## when randomly drawing a sample of size @var{n} without replacement from a
+## population of total size @var{t} containing @var{m} marked items.
 ##
 ## The parameters @var{t}, @var{m}, and @var{n} must be positive integers
 ## with @var{m} and @var{n} not greater than @var{t}.
--- a/scripts/statistics/distributions/hygeinv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/hygeinv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,12 +19,13 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} hygeinv (@var{x}, @var{t}, @var{m}, @var{n})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the hypergeometric distribution with parameters
-## @var{t}, @var{m}, and @var{n}.  This is the probability of obtaining @var{x}
-## marked items when randomly drawing a sample of size @var{n} without
-## replacement from a population of total size @var{t} containing @var{m}
-## marked items.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the hypergeometric distribution with parameters
+## @var{t}, @var{m}, and @var{n}.
+##
+## This is the probability of obtaining @var{x} marked items when randomly
+## drawing a sample of size @var{n} without replacement from a population of
+## total size @var{t} containing @var{m} marked items.
 ##
 ## The parameters @var{t}, @var{m}, and @var{n} must be positive integers
 ## with @var{m} and @var{n} not greater than @var{t}.
--- a/scripts/statistics/distributions/hygepdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/hygepdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,10 +20,11 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} hygepdf (@var{x}, @var{t}, @var{m}, @var{n})
 ## Compute the probability density function (PDF) at @var{x} of the
-## hypergeometric distribution with parameters @var{t}, @var{m}, and
-## @var{n}.  This is the probability of obtaining @var{x} marked items
-## when randomly drawing a sample of size @var{n} without replacement
-## from a population of total size @var{t} containing @var{m} marked items.
+## hypergeometric distribution with parameters @var{t}, @var{m}, and @var{n}.
+##
+## This is the probability of obtaining @var{x} marked items when randomly
+## drawing a sample of size @var{n} without replacement from a population of
+## total size @var{t} containing @var{m} marked items.
 ##
 ## The parameters @var{t}, @var{m}, and @var{n} must be positive integers
 ## with @var{m} and @var{n} not greater than @var{t}.
--- a/scripts/statistics/distributions/kolmogorov_smirnov_cdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/kolmogorov_smirnov_cdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,7 +20,9 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} kolmogorov_smirnov_cdf (@var{x}, @var{tol})
 ## Return the cumulative distribution function (CDF) at @var{x} of the
-## Kolmogorov-Smirnov distribution,
+## Kolmogorov-Smirnov distribution.
+##
+## This is defined as
 ## @tex
 ## $$ Q(x) = \sum_{k=-\infty}^\infty (-1)^k \exp (-2 k^2 x^2) $$
 ## @end tex
--- a/scripts/statistics/distributions/laplace_cdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/laplace_cdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} laplace_cdf (@var{x})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of the Laplace distribution.
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of the Laplace distribution.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/laplace_inv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/laplace_inv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} laplace_inv (@var{x})
-## For each element of @var{x}, compute the quantile (the inverse of the
-## CDF) at @var{x} of the Laplace distribution.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the Laplace distribution.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/laplace_pdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/laplace_pdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} laplace_pdf (@var{x})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the Laplace distribution.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the Laplace distribution.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/logistic_inv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/logistic_inv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} logistic_inv (@var{x})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the logistic distribution.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the logistic distribution.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/logncdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/logncdf.m	Sun May 10 16:07:41 2015 -0700
@@ -22,9 +22,10 @@
 ## @deftypefnx {Function File} {} logncdf (@var{x}, @var{mu}, @var{sigma})
 ## For each element of @var{x}, compute the cumulative distribution function
 ## (CDF) at @var{x} of the lognormal distribution with parameters
-## @var{mu} and @var{sigma}.  If a random variable follows this distribution,
-## its logarithm is normally distributed with mean @var{mu} and standard
-## deviation @var{sigma}.
+## @var{mu} and @var{sigma}.
+##
+## If a random variable follows this distribution, its logarithm is normally
+## distributed with mean @var{mu} and standard deviation @var{sigma}.
 ##
 ## Default values are @var{mu} = 0, @var{sigma} = 1.
 ## @end deftypefn
--- a/scripts/statistics/distributions/logninv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/logninv.m	Sun May 10 16:07:41 2015 -0700
@@ -20,11 +20,12 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} logninv (@var{x})
 ## @deftypefnx {Function File} {} logninv (@var{x}, @var{mu}, @var{sigma})
-## For each element of @var{x}, compute the quantile (the inverse of the
-## CDF) at @var{x} of the lognormal distribution with parameters
-## @var{mu} and @var{sigma}.  If a random variable follows this distribution,
-## its logarithm is normally distributed with mean @var{mu} and standard
-## deviation @var{sigma}.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the lognormal distribution with parameters
+## @var{mu} and @var{sigma}.
+##
+## If a random variable follows this distribution, its logarithm is normally
+## distributed with mean @var{mu} and standard deviation @var{sigma}.
 ##
 ## Default values are @var{mu} = 0, @var{sigma} = 1.
 ## @end deftypefn
--- a/scripts/statistics/distributions/lognpdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/lognpdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,11 +20,12 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} lognpdf (@var{x})
 ## @deftypefnx {Function File} {} lognpdf (@var{x}, @var{mu}, @var{sigma})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the lognormal distribution with parameters
-## @var{mu} and @var{sigma}.  If a random variable follows this distribution,
-## its logarithm is normally distributed with mean @var{mu} and standard
-## deviation @var{sigma}.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the lognormal distribution with parameters
+## @var{mu} and @var{sigma}.
+##
+## If a random variable follows this distribution, its logarithm is normally
+## distributed with mean @var{mu} and standard deviation @var{sigma}.
 ##
 ## Default values are @var{mu} = 0, @var{sigma} = 1.
 ## @end deftypefn
--- a/scripts/statistics/distributions/nbincdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/nbincdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,15 +20,14 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} nbincdf (@var{x}, @var{n}, @var{p})
 ## For each element of @var{x}, compute the cumulative distribution function
-## (CDF) at @var{x} of the negative binomial distribution with
-## parameters @var{n} and @var{p}.
+## (CDF) at @var{x} of the negative binomial distribution with parameters
+## @var{n} and @var{p}.
 ##
-## When @var{n} is integer this is the Pascal distribution.  When
-## @var{n} is extended to real numbers this is the Polya distribution.
+## When @var{n} is integer this is the Pascal distribution.
+## When @var{n} is extended to real numbers this is the Polya distribution.
 ##
-## The number of failures in a Bernoulli experiment with success
-## probability @var{p} before the @var{n}-th success follows this
-## distribution.
+## The number of failures in a Bernoulli experiment with success probability
+## @var{p} before the @var{n}-th success follows this distribution.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/nbininv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/nbininv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,16 +19,15 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} nbininv (@var{x}, @var{n}, @var{p})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the negative binomial distribution
-## with parameters @var{n} and @var{p}.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the negative binomial distribution with parameters
+## @var{n} and @var{p}.
 ##
-## When @var{n} is integer this is the Pascal distribution.  When
-## @var{n} is extended to real numbers this is the Polya distribution.
+## When @var{n} is integer this is the Pascal distribution.
+## When @var{n} is extended to real numbers this is the Polya distribution.
 ##
-## The number of failures in a Bernoulli experiment with success
-## probability @var{p} before the @var{n}-th success follows this
-## distribution.
+## The number of failures in a Bernoulli experiment with success probability
+## @var{p} before the @var{n}-th success follows this distribution.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/nbinpdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/nbinpdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,16 +19,15 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} nbinpdf (@var{x}, @var{n}, @var{p})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the negative binomial distribution with
-## parameters @var{n} and @var{p}.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the negative binomial distribution with parameters
+## @var{n} and @var{p}.
 ##
-## When @var{n} is integer this is the Pascal distribution.  When
-## @var{n} is extended to real numbers this is the Polya distribution.
+## When @var{n} is integer this is the Pascal distribution.
+## When @var{n} is extended to real numbers this is the Polya distribution.
 ##
-## The number of failures in a Bernoulli experiment with success
-## probability @var{p} before the @var{n}-th success follows this
-## distribution.
+## The number of failures in a Bernoulli experiment with success probability
+## @var{p} before the @var{n}-th success follows this distribution.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/nbinrnd.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/nbinrnd.m	Sun May 10 16:07:41 2015 -0700
@@ -22,8 +22,8 @@
 ## @deftypefnx {Function File} {} nbinrnd (@var{n}, @var{p}, @var{r})
 ## @deftypefnx {Function File} {} nbinrnd (@var{n}, @var{p}, @var{r}, @var{c}, @dots{})
 ## @deftypefnx {Function File} {} nbinrnd (@var{n}, @var{p}, [@var{sz}])
-## Return a matrix of random samples from the negative binomial
-## distribution with parameters @var{n} and @var{p}.
+## Return a matrix of random samples from the negative binomial distribution
+## with parameters @var{n} and @var{p}.
 ##
 ## When called with a single size argument, return a square matrix with
 ## the dimension specified.  When called with more than one scalar argument the
--- a/scripts/statistics/distributions/normcdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/normcdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,9 +20,9 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} normcdf (@var{x})
 ## @deftypefnx {Function File} {} normcdf (@var{x}, @var{mu}, @var{sigma})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of the normal distribution with mean
-## @var{mu} and standard deviation @var{sigma}.
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of the normal distribution with mean @var{mu} and
+## standard deviation @var{sigma}.
 ##
 ## Default values are @var{mu} = 0, @var{sigma} = 1.
 ## @end deftypefn
--- a/scripts/statistics/distributions/norminv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/norminv.m	Sun May 10 16:07:41 2015 -0700
@@ -20,8 +20,8 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} norminv (@var{x})
 ## @deftypefnx {Function File} {} norminv (@var{x}, @var{mu}, @var{sigma})
-## For each element of @var{x}, compute the quantile (the inverse of the
-## CDF) at @var{x} of the normal distribution with mean @var{mu} and
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the normal distribution with mean @var{mu} and
 ## standard deviation @var{sigma}.
 ##
 ## Default values are @var{mu} = 0, @var{sigma} = 1.
--- a/scripts/statistics/distributions/normpdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/normpdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,8 +20,8 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} normpdf (@var{x})
 ## @deftypefnx {Function File} {} normpdf (@var{x}, @var{mu}, @var{sigma})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the normal distribution with mean @var{mu} and
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the normal distribution with mean @var{mu} and
 ## standard deviation @var{sigma}.
 ##
 ## Default values are @var{mu} = 0, @var{sigma} = 1.
--- a/scripts/statistics/distributions/poisscdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/poisscdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} poisscdf (@var{x}, @var{lambda})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of the Poisson distribution with parameter
-## lambda.
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of the Poisson distribution with parameter @var{lambda}.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/poissinv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/poissinv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} poissinv (@var{x}, @var{lambda})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the Poisson distribution with parameter
-## @var{lambda}.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the Poisson distribution with parameter @var{lambda}.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/poisspdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/poisspdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} poisspdf (@var{x}, @var{lambda})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the Poisson distribution with parameter @var{lambda}.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the Poisson distribution with parameter @var{lambda}.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/stdnormal_cdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/stdnormal_cdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} stdnormal_cdf (@var{x})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of the standard normal distribution
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of the standard normal distribution
 ## (mean = 0, standard deviation = 1).
 ## @end deftypefn
 
--- a/scripts/statistics/distributions/stdnormal_pdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/stdnormal_pdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} stdnormal_pdf (@var{x})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the standard normal distribution (mean = 0,
-## standard deviation = 1).
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the standard normal distribution
+## (mean = 0, standard deviation = 1).
 ## @end deftypefn
 
 ## Author: TT <Teresa.Twaroch@ci.tuwien.ac.at>
--- a/scripts/statistics/distributions/tcdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/tcdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,9 +20,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} tcdf (@var{x}, @var{n})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of the t (Student) distribution with
-## @var{n} degrees of freedom, i.e., PROB (t(@var{n}) @leq{} @var{x}).
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of the t (Student) distribution with
+## @var{n} degrees of freedom.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/tinv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/tinv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,10 +19,12 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} tinv (@var{x}, @var{n})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the t (Student) distribution with @var{n}
-## degrees of freedom.  This function is analogous to looking in a table
-## for the t-value of a single-tailed distribution.
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the t (Student) distribution with @var{n}
+## degrees of freedom.
+##
+## This function is analogous to looking in a table for the t-value of a
+## single-tailed distribution.
 ## @end deftypefn
 
 ## For very large n, the "correct" formula does not really work well,
--- a/scripts/statistics/distributions/tpdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/tpdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,9 +19,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} tpdf (@var{x}, @var{n})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of the @var{t} (Student) distribution with @var{n}
-## degrees of freedom.
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of the @var{t} (Student) distribution with
+## @var{n} degrees of freedom.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/distributions/unidcdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/unidcdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} unidcdf (@var{x}, @var{n})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of a discrete uniform distribution which assumes
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of a discrete uniform distribution which assumes
 ## the integer values 1--@var{n} with equal probability.
 ## @end deftypefn
 
--- a/scripts/statistics/distributions/unidinv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/unidinv.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} unidinv (@var{x}, @var{n})
-## For each element of @var{x}, compute the quantile (the inverse of
-## the CDF) at @var{x} of the discrete uniform distribution which assumes
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the discrete uniform distribution which assumes
 ## the integer values 1--@var{n} with equal probability.
 ## @end deftypefn
 
--- a/scripts/statistics/distributions/unidpdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/unidpdf.m	Sun May 10 16:07:41 2015 -0700
@@ -19,13 +19,13 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} unidpdf (@var{x}, @var{n})
-## For each element of @var{x}, compute the probability density function
-## (PDF) at @var{x} of a discrete uniform distribution which assumes
+## For each element of @var{x}, compute the probability density function (PDF)
+## at @var{x} of a discrete uniform distribution which assumes
 ## the integer values 1--@var{n} with equal probability.
 ##
-## Warning: The underlying implementation uses the double class and
-## will only be accurate for @var{n} @leq{} @code{bitmax}
-## (@w{@math{2^{53} - 1}} on IEEE-754 compatible systems).
+## Warning: The underlying implementation uses the double class and will only
+## be accurate for @var{n} @leq{} @code{bitmax} (@w{@math{2^{53} - 1}} on
+## IEEE-754 compatible systems).
 ## @end deftypefn
 
 function pdf = unidpdf (x, n)
--- a/scripts/statistics/distributions/unidrnd.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/unidrnd.m	Sun May 10 16:07:41 2015 -0700
@@ -24,6 +24,7 @@
 ## @deftypefnx {Function File} {} unidrnd (@var{n}, [@var{sz}])
 ## Return a matrix of random samples from the discrete uniform distribution
 ## which assumes the integer values 1--@var{n} with equal probability.
+##
 ## @var{n} may be a scalar or a multi-dimensional array.
 ##
 ## When called with a single size argument, return a square matrix with
--- a/scripts/statistics/distributions/unifcdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/unifcdf.m	Sun May 10 16:07:41 2015 -0700
@@ -20,8 +20,8 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} unifcdf (@var{x})
 ## @deftypefnx {Function File} {} unifcdf (@var{x}, @var{a}, @var{b})
-## For each element of @var{x}, compute the cumulative distribution
-## function (CDF) at @var{x} of the uniform distribution on the interval
+## For each element of @var{x}, compute the cumulative distribution function
+## (CDF) at @var{x} of the uniform distribution on the interval
 ## [@var{a}, @var{b}].
 ##
 ## Default values are @var{a} = 0, @var{b} = 1.
--- a/scripts/statistics/distributions/unifinv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/unifinv.m	Sun May 10 16:07:41 2015 -0700
@@ -20,9 +20,8 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} unifinv (@var{x})
 ## @deftypefnx {Function File} {} unifinv (@var{x}, @var{a}, @var{b})
-## For each element of @var{x}, compute the quantile (the inverse of the
-## CDF) at @var{x} of the uniform distribution on the interval
-## [@var{a}, @var{b}].
+## For each element of @var{x}, compute the quantile (the inverse of the CDF)
+## at @var{x} of the uniform distribution on the interval [@var{a}, @var{b}].
 ##
 ## Default values are @var{a} = 0, @var{b} = 1.
 ## @end deftypefn
--- a/scripts/statistics/distributions/wblcdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/wblcdf.m	Sun May 10 16:07:41 2015 -0700
@@ -23,7 +23,9 @@
 ## @deftypefnx {Function File} {} wblcdf (@var{x}, @var{scale}, @var{shape})
 ## Compute the cumulative distribution function (CDF) at @var{x} of the
 ## Weibull distribution with scale parameter @var{scale} and shape
-## parameter @var{shape}, which is
+## parameter @var{shape}.
+##
+## This is defined as
 ## @tex
 ## $$ 1 - e^{-({x \over scale})^{shape}} $$
 ## for $x \geq 0$.
--- a/scripts/statistics/distributions/wblinv.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/wblinv.m	Sun May 10 16:07:41 2015 -0700
@@ -22,8 +22,8 @@
 ## @deftypefnx {Function File} {} wblinv (@var{x}, @var{scale})
 ## @deftypefnx {Function File} {} wblinv (@var{x}, @var{scale}, @var{shape})
 ## Compute the quantile (the inverse of the CDF) at @var{x} of the
-## Weibull distribution with scale parameter @var{scale} and shape
-## parameter @var{shape}.
+## Weibull distribution with scale parameter @var{scale} and
+## shape parameter @var{shape}.
 ##
 ## Default values are @var{scale} = 1, @var{shape} = 1.
 ## @end deftypefn
--- a/scripts/statistics/distributions/wblpdf.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/wblpdf.m	Sun May 10 16:07:41 2015 -0700
@@ -22,8 +22,10 @@
 ## @deftypefnx {Function File} {} wblpdf (@var{x}, @var{scale})
 ## @deftypefnx {Function File} {} wblpdf (@var{x}, @var{scale}, @var{shape})
 ## Compute the probability density function (PDF) at @var{x} of the
-## Weibull distribution with scale parameter @var{scale} and shape
-## parameter @var{shape} which is given by
+## Weibull distribution with scale parameter @var{scale} and
+## shape parameter @var{shape}.
+##
+## This is given by
 ## @tex
 ## $$  {shape \over scale^{shape}} \cdot x^{shape-1} \cdot e^{-({x \over scale})^{shape}} $$
 ## @end tex
--- a/scripts/statistics/distributions/wienrnd.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/distributions/wienrnd.m	Sun May 10 16:07:41 2015 -0700
@@ -19,11 +19,13 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} wienrnd (@var{t}, @var{d}, @var{n})
 ## Return a simulated realization of the @var{d}-dimensional Wiener Process
-## on the interval [0, @var{t}].  If @var{d} is omitted, @var{d} = 1 is
-## used.  The first column of the return matrix contains time, the
-## remaining columns contain the Wiener process.
+## on the interval [0, @var{t}].
 ##
-## The optional parameter @var{n} gives the number of summands used for
+## If @var{d} is omitted, @var{d} = 1 is used.  The first column of the
+## return matrix contains time, the remaining columns contain the Wiener
+## process.
+##
+## The optional parameter @var{n} defines the number of summands used for
 ## simulating the process over an interval of length 1.  If @var{n} is
 ## omitted, @var{n} = 1000 is used.
 ## @end deftypefn
--- a/scripts/statistics/models/private/logistic_regression_derivatives.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/models/private/logistic_regression_derivatives.m	Sun May 10 16:07:41 2015 -0700
@@ -20,6 +20,7 @@
 ## @deftypefn {Function File} {[@var{dl}, @var{d2l}] =} logistic_regression_derivatives (@var{x}, @var{z}, @var{z1}, @var{g}, @var{g1}, @var{p})
 ## Calculate derivatives of the log-likelihood for ordinal logistic regression
 ## model.
+##
 ## Private function called by @code{logistic_regression}.
 ## @seealso{logistic_regression}
 ## @end deftypefn
--- a/scripts/statistics/models/private/logistic_regression_likelihood.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/models/private/logistic_regression_likelihood.m	Sun May 10 16:07:41 2015 -0700
@@ -19,6 +19,7 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{g}, @var{g1}, @var{p}, @var{dev}] =} logistic_regression_likelihood (@var{y}, @var{x}, @var{beta}, @var{z}, @var{z1})
 ## Calculate the likelihood for the ordinal logistic regression model.
+##
 ## Private function called by @code{logistic_regression}.
 ## @seealso{logistic_regression}
 ## @end deftypefn
--- a/scripts/statistics/tests/anova.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/anova.m	Sun May 10 16:07:41 2015 -0700
@@ -18,27 +18,28 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{f}, @var{df_b}, @var{df_w}] =} anova (@var{y}, @var{g})
-## Perform a one-way analysis of variance (ANOVA).  The goal is to test
-## whether the population means of data taken from @var{k} different
-## groups are all equal.
+## Perform a one-way analysis of variance (ANOVA).
+##
+## The goal is to test whether the population means of data taken from
+## @var{k} different groups are all equal.
 ##
-## Data may be given in a single vector @var{y} with groups specified by
-## a corresponding vector of group labels @var{g} (e.g., numbers from 1
-## to @var{k}).  This is the general form which does not impose any
-## restriction on the number of data in each group or the group labels.
+## Data may be given in a single vector @var{y} with groups specified by a
+## corresponding vector of group labels @var{g} (e.g., numbers from 1 to
+## @var{k}).  This is the general form which does not impose any restriction
+## on the number of data in each group or the group labels.
 ##
-## If @var{y} is a matrix and @var{g} is omitted, each column of @var{y}
-## is treated as a group.  This form is only appropriate for balanced
-## ANOVA in which the numbers of samples from each group are all equal.
+## If @var{y} is a matrix and @var{g} is omitted, each column of @var{y} is
+## treated as a group.  This form is only appropriate for balanced ANOVA in
+## which the numbers of samples from each group are all equal.
 ##
 ## Under the null of constant means, the statistic @var{f} follows an F
 ## distribution with @var{df_b} and @var{df_w} degrees of freedom.
 ##
-## The p-value (1 minus the CDF of this distribution at @var{f}) is
-## returned in @var{pval}.
+## The p-value (1 minus the CDF of this distribution at @var{f}) is returned
+## in @var{pval}.
 ##
-## If no output argument is given, the standard one-way ANOVA table is
-## printed.
+## If no output argument is given, the standard one-way ANOVA table is printed.
+## @seealso{manova}
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/tests/chisquare_test_homogeneity.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/chisquare_test_homogeneity.m	Sun May 10 16:07:41 2015 -0700
@@ -24,8 +24,8 @@
 ## (strictly increasing) entries of @var{c}.
 ##
 ## For large samples, the test statistic @var{chisq} approximately follows a
-## chisquare distribution with @var{df} = @code{length (@var{c})}
-## degrees of freedom.
+## chisquare distribution with @var{df} = @code{length (@var{c})} degrees of
+## freedom.
 ##
 ## The p-value (1 minus the CDF of this distribution at @var{chisq}) is
 ## returned in @var{pval}.
--- a/scripts/statistics/tests/chisquare_test_independence.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/chisquare_test_independence.m	Sun May 10 16:07:41 2015 -0700
@@ -18,13 +18,14 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{chisq}, @var{df}] =} chisquare_test_independence (@var{x})
-## Perform a chi-square test for independence based on the contingency
-## table @var{x}.  Under the null hypothesis of independence,
-## @var{chisq} approximately has a chi-square distribution with
-## @var{df} degrees of freedom.
+## Perform a chi-square test for independence based on the contingency table
+## @var{x}.
 ##
-## The p-value (1 minus the CDF of this distribution at chisq) of the
-## test is returned in @var{pval}.
+## Under the null hypothesis of independence, @var{chisq} approximately has a
+## chi-square distribution with @var{df} degrees of freedom.
+##
+## The p-value (1 minus the CDF of this distribution at chisq) of the test is
+## returned in @var{pval}.
 ##
 ## If no output argument is given, the p-value is displayed.
 ## @end deftypefn
--- a/scripts/statistics/tests/cor_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/cor_test.m	Sun May 10 16:07:41 2015 -0700
@@ -22,19 +22,19 @@
 ## populations.
 ##
 ## The optional argument string @var{alt} describes the alternative
-## hypothesis, and can be @qcode{"!="} or @qcode{"<>"} (nonzero),
-## @qcode{">"} (greater than 0), or @qcode{"<"} (less than 0).  The
-## default is the two-sided case.
+## hypothesis, and can be @qcode{"!="} or @qcode{"<>"} (nonzero), @qcode{">"}
+## (greater than 0), or @qcode{"<"} (less than 0).  The default is the
+## two-sided case.
 ##
-## The optional argument string @var{method} specifies which
-## correlation coefficient to use for testing.  If @var{method} is
-## @qcode{"pearson"} (default), the (usual) Pearson's product moment
-## correlation coefficient is used.  In this case, the data should come
-## from a bivariate normal distribution.  Otherwise, the other two
-## methods offer nonparametric alternatives.  If @var{method} is
-## @qcode{"kendall"}, then Kendall's rank correlation tau is used.  If
-## @var{method} is @qcode{"spearman"}, then Spearman's rank correlation
-## rho is used.  Only the first character is necessary.
+## The optional argument string @var{method} specifies which correlation
+## coefficient to use for testing.  If @var{method} is @qcode{"pearson"}
+## (default), the (usual) Pearson's produt moment correlation coefficient is
+## used.  In this case, the data should come from a bivariate normal
+## distribution.  Otherwise, the other two methods offer nonparametric
+## alternatives.  If @var{method} is @qcode{"kendall"}, then Kendall's rank
+## correlation tau is used.  If @var{method} is @qcode{"spearman"}, then
+## Spearman's rank correlation rho is used.  Only the first character is
+## necessary.
 ##
 ## The output is a structure with the following elements:
 ##
--- a/scripts/statistics/tests/f_test_regression.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/f_test_regression.m	Sun May 10 16:07:41 2015 -0700
@@ -21,11 +21,11 @@
 ## Perform an F test for the null hypothesis @nospell{rr * b = r} in a
 ## classical normal regression model y = X * b + e.
 ##
-## Under the null, the test statistic @var{f} follows an F distribution
-## with @var{df_num} and @var{df_den} degrees of freedom.
+## Under the null, the test statistic @var{f} follows an F distribution with
+## @var{df_num} and @var{df_den} degrees of freedom.
 ##
-## The p-value (1 minus the CDF of this distribution at @var{f}) is
-## returned in @var{pval}.
+## The p-value (1 minus the CDF of this distribution at @var{f}) is returned
+## in @var{pval}.
 ##
 ## If not given explicitly, @var{r} = 0.
 ##
--- a/scripts/statistics/tests/hotelling_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/hotelling_test.m	Sun May 10 16:07:41 2015 -0700
@@ -19,8 +19,8 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{tsq}] =} hotelling_test (@var{x}, @var{m})
 ## For a sample @var{x} from a multivariate normal distribution with unknown
-## mean and covariance matrix, test the null hypothesis that @code{mean
-## (@var{x}) == @var{m}}.
+## mean and covariance matrix, test the null hypothesis that
+## @code{mean (@var{x}) == @var{m}}.
 ##
 ## Hotelling's @math{T^2} is returned in @var{tsq}.  Under the null,
 ## @math{(n-p) T^2 / (p(n-1))} has an F distribution with @math{p} and
--- a/scripts/statistics/tests/kolmogorov_smirnov_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/kolmogorov_smirnov_test.m	Sun May 10 16:07:41 2015 -0700
@@ -19,7 +19,8 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{ks}] =} kolmogorov_smirnov_test (@var{x}, @var{dist}, @var{params}, @var{alt})
 ## Perform a Kolmogorov-Smirnov test of the null hypothesis that the
-## sample @var{x} comes from the (continuous) distribution dist.  I.e.,
+## sample @var{x} comes from the (continuous) distribution @var{dist}.
+##
 ## if F and G are the CDFs corresponding to the sample and dist,
 ## respectively, then the null is that F == G.
 ##
@@ -32,18 +33,18 @@
 ## @end example
 ##
 ## @noindent
-## @var{dist} can be any string for which a function @var{dist_cdf}
+## @var{dist} can be any string for which a function @var{distcdf}
 ## that calculates the CDF of distribution @var{dist} exists.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative F
-## != G@.  In this case, the test statistic @var{ks} follows a two-sided
-## Kolmogorov-Smirnov distribution.  If @var{alt} is @qcode{">"}, the
-## one-sided alternative F > G is considered.  Similarly for @qcode{"<"},
-## the one-sided alternative F > G is considered.  In this case, the
-## test statistic @var{ks} has a one-sided Kolmogorov-Smirnov
-## distribution.  The default is the two-sided case.
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative F != G@.  In this case, the
+## test statistic @var{ks} follows a two-sided Kolmogorov-Smirnov
+## distribution.  If @var{alt} is @qcode{">"}, the one-sided alternative F >
+## G is considered.  Similarly for @qcode{"<"}, the one-sided alternative F >
+## G is considered.  In this case, the test statistic @var{ks} has a
+## one-sided Kolmogorov-Smirnov distribution.  The default is the two-sided
+## case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/kolmogorov_smirnov_test_2.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/kolmogorov_smirnov_test_2.m	Sun May 10 16:07:41 2015 -0700
@@ -18,21 +18,21 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{ks}, @var{d}] =} kolmogorov_smirnov_test_2 (@var{x}, @var{y}, @var{alt})
-## Perform a 2-sample Kolmogorov-Smirnov test of the null hypothesis
-## that the samples @var{x} and @var{y} come from the same (continuous)
-## distribution.  I.e., if F and G are the CDFs corresponding to the
-## @var{x} and @var{y} samples, respectively, then the null is that F ==
-## G.
+## Perform a 2-sample Kolmogorov-Smirnov test of the null hypothesis that the
+## samples @var{x} and @var{y} come from the same (continuous) distribution.
+##
+## If F and G are the CDFs corresponding to the @var{x} and @var{y} samples,
+## respectively, then the null is that F == G.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative F
-## != G@.  In this case, the test statistic @var{ks} follows a two-sided
-## Kolmogorov-Smirnov distribution.  If @var{alt} is @qcode{">"}, the
-## one-sided alternative F > G is considered.  Similarly for @qcode{"<"},
-## the one-sided alternative F < G is considered.  In this case, the
-## test statistic @var{ks} has a one-sided Kolmogorov-Smirnov
-## distribution.  The default is the two-sided case.
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative F != G@.  In this case, the
+## test statistic @var{ks} follows a two-sided Kolmogorov-Smirnov
+## distribution.  If @var{alt} is @qcode{">"}, the one-sided alternative F >
+## G is considered.  Similarly for @qcode{"<"}, the one-sided alternative F <
+## G is considered.  In this case, the test statistic @var{ks} has a
+## one-sided Kolmogorov-Smirnov distribution.  The default is the two-sided
+## case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/kruskal_wallis_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/kruskal_wallis_test.m	Sun May 10 16:07:41 2015 -0700
@@ -20,29 +20,27 @@
 ## @deftypefn {Function File} {[@var{pval}, @var{k}, @var{df}] =} kruskal_wallis_test (@var{x1}, @dots{})
 ## Perform a @nospell{Kruskal-Wallis} one-factor analysis of variance.
 ##
-## Suppose a variable is observed for @var{k} > 1 different groups, and
-## let @var{x1}, @dots{}, @var{xk} be the corresponding data vectors.
+## Suppose a variable is observed for @var{k} > 1 different groups, and let
+## @var{x1}, @dots{}, @var{xk} be the corresponding data vectors.
 ##
 ## Under the null hypothesis that the ranks in the pooled sample are not
 ## affected by the group memberships, the test statistic @var{k} is
-## approximately chi-square with @var{df} = @var{k} - 1 degrees of
-## freedom.
+## approximately chi-square with @var{df} = @var{k} - 1 degrees of freedom.
 ##
 ## If the data contains ties (some value appears more than once)
 ## @var{k} is divided by
 ##
 ## 1 - @var{sum_ties} / (@var{n}^3 - @var{n})
 ##
-## where @var{sum_ties} is the sum of @var{t}^2 - @var{t} over each group
-## of ties where @var{t} is the number of ties in the group and @var{n}
-## is the total number of values in the input data.  For more info on
-## this adjustment see @nospell{William H. Kruskal and W. Allen Wallis},
+## where @var{sum_ties} is the sum of @var{t}^2 - @var{t} over each group of
+## ties where @var{t} is the number of ties in the group and @var{n} is the
+## total number of values in the input data.  For more info on this
+## adjustment see @nospell{William H. Kruskal and W. Allen Wallis},
 ## @cite{Use of Ranks in One-Criterion Variance Analysis},
-## Journal of the American Statistical Association, Vol. 47,
-## No. 260 (Dec 1952).
+## Journal of the American Statistical Association, Vol. 47, No. 260 (Dec 1952).
 ##
-## The p-value (1 minus the CDF of this distribution at @var{k}) is
-## returned in @var{pval}.
+## The p-value (1 minus the CDF of this distribution at @var{k}) is returned
+## in @var{pval}.
 ##
 ## If no output argument is given, the p-value is displayed.
 ## @end deftypefn
--- a/scripts/statistics/tests/manova.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/manova.m	Sun May 10 16:07:41 2015 -0700
@@ -18,18 +18,20 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} manova (@var{x}, @var{g})
-## Perform a one-way multivariate analysis of variance (MANOVA).  The
-## goal is to test whether the p-dimensional population means of data
-## taken from @var{k} different groups are all equal.  All data are
-## assumed drawn independently from p-dimensional normal distributions
-## with the same covariance matrix.
+## Perform a one-way multivariate analysis of variance (MANOVA).
 ##
-## The data matrix is given by @var{x}.  As usual, rows are observations
-## and columns are variables.  The vector @var{g} specifies the
-## corresponding group labels (e.g., numbers from 1 to @var{k}).
+## The goal is to test whether the p-dimensional population means of data
+## taken from @var{k} different groups are all equal.  All data are assumed
+## drawn independently from p-dimensional normal distributions with the same
+## covariance matrix.
+##
+## The data matrix is given by @var{x}.  As usual, rows are observations and
+## columns are variables.  The vector @var{g} specifies the corresponding
+## group labels (e.g., numbers from 1 to @var{k}).
 ##
 ## The LR test statistic (@nospell{Wilks' Lambda}) and approximate p-values are
 ## computed and displayed.
+## @seealso{anova}
 ## @end deftypefn
 
 ## The Hotelling-Lawley and Pillai-Bartlett test statistics are coded.
--- a/scripts/statistics/tests/mcnemar_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/mcnemar_test.m	Sun May 10 16:07:41 2015 -0700
@@ -18,12 +18,12 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{chisq}, @var{df}] =} mcnemar_test (@var{x})
-## For a square contingency table @var{x} of data cross-classified on
-## the row and column variables, @nospell{McNemar's} test can be used for
-## testing the null hypothesis of symmetry of the classification probabilities.
+## For a square contingency table @var{x} of data cross-classified on the row
+## and column variables, @nospell{McNemar's} test can be used for testing the
+## null hypothesis of symmetry of the classification probabilities.
 ##
-## Under the null, @var{chisq} is approximately distributed as chisquare
-## with @var{df} degrees of freedom.
+## Under the null, @var{chisq} is approximately distributed as chisquare with
+## @var{df} degrees of freedom.
 ##
 ## The p-value (1 minus the CDF of this distribution at @var{chisq}) is
 ## returned in @var{pval}.
--- a/scripts/statistics/tests/prop_test_2.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/prop_test_2.m	Sun May 10 16:07:41 2015 -0700
@@ -18,19 +18,20 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{z}] =} prop_test_2 (@var{x1}, @var{n1}, @var{x2}, @var{n2}, @var{alt})
-## If @var{x1} and @var{n1} are the counts of successes and trials in
-## one sample, and @var{x2} and @var{n2} those in a second one, test the
-## null hypothesis that the success probabilities @var{p1} and @var{p2}
-## are the same.  Under the null, the test statistic @var{z}
-## approximately follows a standard normal distribution.
+## If @var{x1} and @var{n1} are the counts of successes and trials in one
+## sample, and @var{x2} and @var{n2} those in a second one, test the null
+## hypothesis that the success probabilities @var{p1} and @var{p2} are the
+## same.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative
-## @var{p1} != @var{p2}.  If @var{alt} is @qcode{">"}, the one-sided
-## alternative @var{p1} > @var{p2} is used.  Similarly for @qcode{"<"},
-## the one-sided alternative @var{p1} < @var{p2} is used.
-## The default is the two-sided case.
+## Under the null, the test statistic @var{z} approximately follows a
+## standard normal distribution.
+##
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative @var{p1} != @var{p2}.  If
+## @var{alt} is @qcode{">"}, the one-sided alternative @var{p1} > @var{p2} is
+## used.  Similarly for @qcode{"<"}, the one-sided alternative
+## @var{p1} < @var{p2} is used.  The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/run_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/run_test.m	Sun May 10 16:07:41 2015 -0700
@@ -18,9 +18,11 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{chisq}] =} run_test (@var{x})
-## Perform a chi-square test with 6 degrees of freedom based on the
-## upward runs in the columns of @var{x}.  Can be used to test whether
-## @var{x} contains independent data.
+## Perform a chi-square test with 6 degrees of freedom based on the upward
+## runs in the columns of @var{x}.
+##
+## @code{run_test} can be used to decide whether @var{x} contains independent
+## data.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/sign_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/sign_test.m	Sun May 10 16:07:41 2015 -0700
@@ -19,20 +19,21 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{b}, @var{n}] =} sign_test (@var{x}, @var{y}, @var{alt})
 ## For two matched-pair samples @var{x} and @var{y}, perform a sign test
-## of the null hypothesis PROB (@var{x} > @var{y}) == PROB (@var{x} <
-## @var{y}) == 1/2.  Under the null, the test statistic @var{b} roughly
-## follows a binomial distribution with parameters @code{@var{n} = sum
-## (@var{x} != @var{y})} and @var{p} = 1/2.
+## of the null hypothesis
+## PROB (@var{x} > @var{y}) == PROB (@var{x} < @var{y}) == 1/2.
+##
+## Under the null, the test statistic @var{b} roughly follows a
+## binomial distribution with parameters
+## @code{@var{n} = sum (@var{x} != @var{y})} and @var{p} = 1/2.
 ##
-## With the optional argument @code{alt}, the alternative of interest
-## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the
-## null hypothesis is tested against the two-sided alternative PROB
-## (@var{x} < @var{y}) != 1/2.  If @var{alt} is @qcode{">"}, the
-## one-sided alternative PROB (@var{x} > @var{y}) > 1/2 ("x is
-## stochastically greater than y") is considered.  Similarly for
-## @qcode{"<"}, the one-sided alternative PROB (@var{x} > @var{y}) < 1/2
-## ("x is stochastically less than y") is considered.  The default is
-## the two-sided case.
+## With the optional argument @code{alt}, the alternative of interest can be
+## selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## hypothesis is tested against the two-sided alternative
+## PROB (@var{x} < @var{y}) != 1/2.  If @var{alt} is @qcode{">"}, the one-sided
+## alternative PROB (@var{x} > @var{y}) > 1/2 ("x is stochastically greater
+## than y") is considered.  Similarly for @qcode{"<"}, the one-sided
+## alternative PROB (@var{x} > @var{y}) < 1/2 ("x is stochastically less than
+## y") is considered.  The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/t_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/t_test.m	Sun May 10 16:07:41 2015 -0700
@@ -19,19 +19,19 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{t}, @var{df}] =} t_test (@var{x}, @var{m}, @var{alt})
 ## For a sample @var{x} from a normal distribution with unknown mean and
-## variance, perform a t-test of the null hypothesis @code{mean
-## (@var{x}) == @var{m}}.  Under the null, the test statistic @var{t}
-## follows a Student distribution with @code{@var{df} = length (@var{x})
-## - 1} degrees of freedom.
+## variance, perform a t-test of the null hypothesis
+## @code{mean (@var{x}) == @var{m}}.
+##
+## Under the null, the test statistic @var{t} follows a Student distribution
+## with @code{@var{df} = length (@var{x}) - 1} degrees of freedom.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative
-## @code{mean (@var{x}) != @var{m}}.  If @var{alt} is @qcode{">"}, the
-## one-sided alternative @code{mean (@var{x}) > @var{m}} is considered.
-## Similarly for @var{"<"}, the one-sided alternative @code{mean
-## (@var{x}) < @var{m}} is considered.  The default is the two-sided
-## case.
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative @code{mean (@var{x}) !=
+## @var{m}}.  If @var{alt} is @qcode{">"}, the one-sided alternative
+## @code{mean (@var{x}) > @var{m}} is considered.  Similarly for @var{"<"},
+## the one-sided alternative @code{mean (@var{x}) < @var{m}} is considered. 
+## The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/t_test_2.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/t_test_2.m	Sun May 10 16:07:41 2015 -0700
@@ -18,20 +18,20 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{t}, @var{df}] =} t_test_2 (@var{x}, @var{y}, @var{alt})
-## For two samples x and y from normal distributions with unknown means
-## and unknown equal variances, perform a two-sample t-test of the null
-## hypothesis of equal means.  Under the null, the test statistic
-## @var{t} follows a Student distribution with @var{df} degrees of
-## freedom.
+## For two samples x and y from normal distributions with unknown means and
+## unknown equal variances, perform a two-sample t-test of the null
+## hypothesis of equal means.
+##
+## Under the null, the test statistic @var{t} follows a Student distribution
+## with @var{df} degrees of freedom.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative
-## @code{mean (@var{x}) != mean (@var{y})}.  If @var{alt} is @qcode{">"},
-## the one-sided alternative @code{mean (@var{x}) > mean (@var{y})} is
-## used.  Similarly for @qcode{"<"}, the one-sided alternative @code{mean
-## (@var{x}) < mean (@var{y})} is used.  The default is the two-sided
-## case.
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative @code{mean (@var{x}) != mean
+## (@var{y})}.  If @var{alt} is @qcode{">"}, the one-sided alternative
+## @code{mean (@var{x}) > mean (@var{y})} is used.  Similarly for
+## @qcode{"<"}, the one-sided alternative @code{mean (@var{x}) < mean
+## (@var{y})} is used.  The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/t_test_regression.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/t_test_regression.m	Sun May 10 16:07:41 2015 -0700
@@ -20,21 +20,20 @@
 ## @deftypefn {Function File} {[@var{pval}, @var{t}, @var{df}] =} t_test_regression (@var{y}, @var{x}, @var{rr}, @var{r}, @var{alt})
 ## Perform a t test for the null hypothesis
 ## @nospell{@code{@var{rr} * @var{b} = @var{r}}} in a classical normal
-## regression model @code{@var{y} = @var{x} * @var{b} + @var{e}}.  Under the
-## null, the test statistic @var{t} follows a @var{t} distribution with
-## @var{df} degrees of freedom.
+## regression model @code{@var{y} = @var{x} * @var{b} + @var{e}}.
+##
+## Under the null, the test statistic @var{t} follows a @var{t} distribution
+## with @var{df} degrees of freedom.
 ##
 ## If @var{r} is omitted, a value of 0 is assumed.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative
-## @nospell{@code{@var{rr} * @var{b} != @var{r}}}.  If @var{alt} is @qcode{">"},
-## the one-sided alternative
-## @nospell{@code{@var{rr} * @var{b} > @var{r}}} is used.  Similarly for
-## @var{"<"}, the one-sided alternative
-## @nospell{@code{@var{rr} * @var{b} < @var{r}}} is used.  The default is the
-## two-sided case.
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative @nospell{@code{@var{rr} *
+## @var{b} != @var{r}}}.  If @var{alt} is @qcode{">"}, the one-sided
+## alternative @nospell{@code{@var{rr} * @var{b} > @var{r}}} is used. 
+## Similarly for @var{"<"}, the one-sided alternative @nospell{@code{@var{rr}
+## * @var{b} < @var{r}}} is used.  The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/u_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/u_test.m	Sun May 10 16:07:41 2015 -0700
@@ -19,18 +19,20 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{z}] =} u_test (@var{x}, @var{y}, @var{alt})
 ## For two samples @var{x} and @var{y}, perform a Mann-Whitney U-test of
-## the null hypothesis PROB (@var{x} > @var{y}) == 1/2 == PROB (@var{x}
-## < @var{y}).  Under the null, the test statistic @var{z} approximately
-## follows a standard normal distribution.  Note that this test is
-## equivalent to the Wilcoxon rank-sum test.
+## the null hypothesis
+## PROB (@var{x} > @var{y}) == 1/2 == PROB (@var{x} < @var{y}).
+##
+## Under the null, the test statistic @var{z} approximately follows a
+## standard normal distribution.  Note that this test is equivalent to the
+## Wilcoxon rank-sum test.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative
-## PROB (@var{x} > @var{y}) != 1/2.  If @var{alt} is @qcode{">"}, the
-## one-sided alternative PROB (@var{x} > @var{y}) > 1/2 is considered.
-## Similarly for @qcode{"<"}, the one-sided alternative PROB (@var{x} >
-## @var{y}) < 1/2 is considered.  The default is the two-sided case.
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative
+## PROB (@var{x} > @var{y}) != 1/2.  If @var{alt} is @qcode{">"}, the one-sided
+## alternative PROB (@var{x} > @var{y}) > 1/2 is considered.  Similarly for
+## @qcode{"<"}, the one-sided alternative PROB (@var{x} > @var{y}) < 1/2 is
+## considered.  The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/var_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/var_test.m	Sun May 10 16:07:41 2015 -0700
@@ -20,18 +20,18 @@
 ## @deftypefn {Function File} {[@var{pval}, @var{f}, @var{df_num}, @var{df_den}] =} var_test (@var{x}, @var{y}, @var{alt})
 ## For two samples @var{x} and @var{y} from normal distributions with
 ## unknown means and unknown variances, perform an F-test of the null
-## hypothesis of equal variances.  Under the null, the test statistic
-## @var{f} follows an F-distribution with @var{df_num} and @var{df_den}
-## degrees of freedom.
+## hypothesis of equal variances.
+##
+## Under the null, the test statistic @var{f} follows an F-distribution with
+## @var{df_num} and @var{df_den} degrees of freedom.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative
-## @code{var (@var{x}) != var (@var{y})}.  If @var{alt} is @qcode{">"},
-## the one-sided alternative @code{var (@var{x}) > var (@var{y})} is
-## used.  Similarly for "<", the one-sided alternative @code{var
-## (@var{x}) > var (@var{y})} is used.  The default is the two-sided
-## case.
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative @code{var (@var{x}) != var
+## (@var{y})}.  If @var{alt} is @qcode{">"}, the one-sided alternative
+## @code{var (@var{x}) > var (@var{y})} is used.  Similarly for "<", the
+## one-sided alternative @code{var (@var{x}) > var (@var{y})} is used.  The
+## default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/welch_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/welch_test.m	Sun May 10 16:07:41 2015 -0700
@@ -21,16 +21,17 @@
 ## For two samples @var{x} and @var{y} from normal distributions with
 ## unknown means and unknown and not necessarily equal variances,
 ## perform a Welch test of the null hypothesis of equal means.
+##
 ## Under the null, the test statistic @var{t} approximately follows a
 ## Student distribution with @var{df} degrees of freedom.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative
 ## @code{mean (@var{x}) != @var{m}}.  If @var{alt} is @qcode{">"}, the
 ## one-sided alternative mean(x) > @var{m} is considered.  Similarly for
-## @qcode{"<"}, the one-sided alternative mean(x) < @var{m} is
-## considered.  The default is the two-sided case.
+## @qcode{"<"}, the one-sided alternative mean(x) < @var{m} is considered.
+## The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/wilcoxon_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/wilcoxon_test.m	Sun May 10 16:07:41 2015 -0700
@@ -19,20 +19,22 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{z}] =} wilcoxon_test (@var{x}, @var{y}, @var{alt})
 ## For two matched-pair sample vectors @var{x} and @var{y}, perform a
-## Wilcoxon signed-rank test of the null hypothesis PROB (@var{x} >
-## @var{y}) == 1/2.  Under the null, the test statistic @var{z}
-## approximately follows a standard normal distribution when @var{n} > 25.
+## Wilcoxon signed-rank test of the null hypothesis
+## PROB (@var{x} > @var{y}) == 1/2.
+##
+## Under the null, the test statistic @var{z} approximately follows a
+## standard normal distribution when @var{n} > 25.
 ##
 ## @strong{Caution:} This function assumes a normal distribution for @var{z}
 ## and thus is invalid for @var{n} @leq{} 25.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative
 ## PROB (@var{x} > @var{y}) != 1/2.  If alt is @qcode{">"}, the one-sided
-## alternative PROB (@var{x} > @var{y}) > 1/2 is considered.  Similarly
-## for @qcode{"<"}, the one-sided alternative PROB (@var{x} > @var{y}) <
-## 1/2 is considered.  The default is the two-sided case.
+## alternative PROB (@var{x} > @var{y}) > 1/2 is considered.  Similarly for
+## @qcode{"<"}, the one-sided alternative PROB (@var{x} > @var{y}) < 1/2 is
+## considered.  The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/z_test.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/z_test.m	Sun May 10 16:07:41 2015 -0700
@@ -18,24 +18,26 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{z}] =} z_test (@var{x}, @var{m}, @var{v}, @var{alt})
-## Perform a Z-test of the null hypothesis @code{mean (@var{x}) ==
-## @var{m}} for a sample @var{x} from a normal distribution with unknown
-## mean and known variance @var{v}.  Under the null, the test statistic
-## @var{z} follows a standard normal distribution.
+## Perform a Z-test of the null hypothesis @code{mean (@var{x}) == @var{m}}
+## for a sample @var{x} from a normal distribution with unknown mean and known
+## variance @var{v}.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative
+## Under the null, the test statistic @var{z} follows a standard normal
+## distribution.
+##
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative
 ## @code{mean (@var{x}) != @var{m}}.  If @var{alt} is @qcode{">"}, the
 ## one-sided alternative @code{mean (@var{x}) > @var{m}} is considered.
-## Similarly for @qcode{"<"}, the one-sided alternative @code{mean
-## (@var{x}) < @var{m}} is considered.  The default is the two-sided
+## Similarly for @qcode{"<"}, the one-sided alternative
+## @code{mean (@var{x}) < @var{m}} is considered.  The default is the two-sided
 ## case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
-## If no output argument is given, the p-value of the test is displayed
-## along with some information.
+## If no output argument is given, the p-value of the test is displayed along
+## with some information.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/statistics/tests/z_test_2.m	Sat May 09 22:50:09 2015 -0700
+++ b/scripts/statistics/tests/z_test_2.m	Sun May 10 16:07:41 2015 -0700
@@ -18,24 +18,26 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{z}] =} z_test_2 (@var{x}, @var{y}, @var{v_x}, @var{v_y}, @var{alt})
-## For two samples @var{x} and @var{y} from normal distributions with
-## unknown means and known variances @var{v_x} and @var{v_y}, perform a
-## Z-test of the hypothesis of equal means.  Under the null, the test
-## statistic @var{z} follows a standard normal distribution.
+## For two samples @var{x} and @var{y} from normal distributions with unknown
+## means and known variances @var{v_x} and @var{v_y}, perform a Z-test of the
+## hypothesis of equal means.
 ##
-## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @qcode{"!="} or
-## @qcode{"<>"}, the null is tested against the two-sided alternative
+## Under the null, the test statistic @var{z} follows a standard normal
+## distribution.
+##
+## With the optional argument string @var{alt}, the alternative of interest
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the null
+## is tested against the two-sided alternative
 ## @code{mean (@var{x}) != mean (@var{y})}.  If alt is @qcode{">"}, the
 ## one-sided alternative @code{mean (@var{x}) > mean (@var{y})} is used.
-## Similarly for @qcode{"<"}, the one-sided alternative @code{mean
-## (@var{x}) < mean (@var{y})} is used.  The default is the two-sided
-## case.
+## Similarly for @qcode{"<"}, the one-sided alternative
+## @code{mean (@var{x}) < mean (@var{y})} is used.  The default is the
+## two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
-## If no output argument is given, the p-value of the test is displayed
-## along with some information.
+## If no output argument is given, the p-value of the test is displayed along
+## with some information.
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>