summaryrefslogtreecommitdiff
path: root/numpy/polynomial/legendre.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/polynomial/legendre.py')
-rw-r--r--numpy/polynomial/legendre.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py
index cd4da2a79..d4cf4accf 100644
--- a/numpy/polynomial/legendre.py
+++ b/numpy/polynomial/legendre.py
@@ -1321,10 +1321,11 @@ def legfit(x, y, deg, rcond=None, full=False, w=None):
default) just the coefficients are returned, when True diagnostic
information from the singular value decomposition is also returned.
w : array_like, shape (`M`,), optional
- Weights. If not None, the contribution of each point
- ``(x[i],y[i])`` to the fit is weighted by ``w[i]``. Ideally the
- weights are chosen so that the errors of the products ``w[i]*y[i]``
- all have the same variance. The default value is None.
+ Weights. If not None, the weight ``w[i]`` applies to the unsquared
+ residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are
+ chosen so that the errors of the products ``w[i]*y[i]`` all have the
+ same variance. When using inverse-variance weighting, use
+ ``w[i] = 1/sigma(y[i])``. The default value is None.
.. versionadded:: 1.5.0