changeset 11917:deb777a926ee release-3-0-x

style fixes
author John W. Eaton <jwe@octave.org>
date Mon, 12 Jan 2009 12:13:21 +0100
parents 377d908f7e40
children f2af2233ce7f
files scripts/ChangeLog scripts/polynomial/polyfit.m scripts/polynomial/polyval.m
diffstat 3 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Mon Jan 12 12:09:30 2009 +0100
+++ b/scripts/ChangeLog	Mon Jan 12 12:13:21 2009 +0100
@@ -1,3 +1,10 @@
+2008-02-19  Ben Abbott  <bpabbott@mac.com>
+
+	* polynomial/polyfit.m: Use QR decomposition.  Handle
+	normalization option.
+	* polynomial/polyval.m: Normalize dependent variable.  Optionally
+	generate 50% prediction intervals.
+
 2008-10-13  Francesco Potorti  <pot@gnu.org>
 
 	* plot/__errplot__.m: Wrong if switch compared strings using ==.
--- a/scripts/polynomial/polyfit.m	Mon Jan 12 12:09:30 2009 +0100
+++ b/scripts/polynomial/polyfit.m	Mon Jan 12 12:13:21 2009 +0100
@@ -24,20 +24,19 @@
 ##
 ## The polynomial coefficients are returned in a row vector.
 ##
-## The second output is a structured variable, @var{s},
-## containing the following fields:
+## The second output is a structure containing the following fields:
 ##
 ## @table @samp
 ## @item R
-##  Triangular factor R from the QR decomposition.
+## Triangular factor R from the QR decomposition.
 ## @item X
-##  The Vandermonde matrix used to compute the polynomial coefficients.
+## The Vandermonde matrix used to compute the polynomial coefficients.
 ## @item df
-##  The degrees of freedom.
+## The degrees of freedom.
 ## @item normr
-##  The norm of the residuals.
+## The norm of the residuals.
 ## @item yf
-##  The values of the polynomial for each value of @var{x}.
+## The values of the polynomial for each value of @var{x}.
 ## @end table
 ##
 ## The second output may be used by @code{polyval} to calculate the 
--- a/scripts/polynomial/polyval.m	Mon Jan 12 12:09:30 2009 +0100
+++ b/scripts/polynomial/polyval.m	Mon Jan 12 12:13:21 2009 +0100
@@ -24,8 +24,8 @@
 ## is present evaluate the polynomial for (@var{x}-@var{mu}(1))/@var{mu}(2).
 ## If @var{x} is a vector or matrix, the polynomial is evaluated for each of
 ## the elements of @var{x}.
-## @deftypefnx {Function File} {[@var{y}, @var{dy}] =} polyval (@var{p}, @var{x}, @var{S})
-## @deftypefnx {Function File} {[@var{y}, @var{dy}] =} polyval (@var{p}, @var{x}, @var{S}, @var{mu})
+## @deftypefnx {Function File} {[@var{y}, @var{dy}] =} polyval (@var{p}, @var{x}, @var{s})
+## @deftypefnx {Function File} {[@var{y}, @var{dy}] =} polyval (@var{p}, @var{x}, @var{s}, @var{mu})
 ## In addition to evaluating the polynomial, the second output 
 ## represents the prediction interval, @var{y} +/- @var{dy}, which
 ## contains at least 50% of the future predictions. To calculate the
@@ -75,10 +75,6 @@
   y = reshape (y, size (x));
 
   if (nargout == 2)
-    ## The line below is *not* the result of a conceptual grasp of statistics.
-    ## Instead, after reading the links below and comparing to the output of Matlab's polyval.m,
-    ## http://www.mathworks.com/access/helpdesk/help/toolbox/stats/index.html?/access/helpdesk/help/toolbox/stats/finv.html
-    ## http://www.mathworks.com/access/helpdesk/help/toolbox/curvefit/index.html?/access/helpdesk/help/toolbox/curvefit/bq_5ka6-1_1.html
     ## Note: the F-Distribution is generally considered to be single-sided.
     ## http://www.itl.nist.gov/div898/handbook/eda/section3/eda3673.htm
     ##   t = finv (1-alpha, s.df, s.df);