diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/lib/polynomial.py | 7 | ||||
-rw-r--r-- | numpy/polynomial/_polybase.py | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 0e691f56e..0de39877a 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -396,7 +396,12 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False): Fit a polynomial ``p(x) = p[0] * x**deg + ... + p[deg]`` of degree `deg` to points `(x, y)`. Returns a vector of coefficients `p` that minimises - the squared error. + the squared error in the order `deg`, `deg-1`, ... `0`. + + The `Polynomial.fit <numpy.polynomial.polynomial.Polynomial.fit>` class + method is recommended for new code as it is more stable numerically. See + the documentation for the method for more information, or the convenience + function `polynomial.polyfit <numpy.polynomial.polynomial.polyfit>`. Parameters ---------- diff --git a/numpy/polynomial/_polybase.py b/numpy/polynomial/_polybase.py index 9f4d30e53..98f16836c 100644 --- a/numpy/polynomial/_polybase.py +++ b/numpy/polynomial/_polybase.py @@ -860,7 +860,9 @@ class ABCPolyBase(object): ------- new_series : series A series that represents the least squares fit to the data and - has the domain specified in the call. + has the domain and window specified in the call. If the + coefficients for the unscaled and unshifted basis polynomials are + of interest, do ``new_series.convert().coef`` [resid, rank, sv, rcond] : list These values are only returned if `full` = True |