summaryrefslogtreecommitdiff
path: root/numpy/polynomial/polynomial.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2012-01-03 10:40:49 -0700
committerCharles Harris <charlesr.harris@gmail.com>2012-01-09 11:09:38 -0700
commit894d93e98c6b35037829dc4f78fd86245becb7ff (patch)
tree0b3e5316a99b336daf26befcba4bfde8d711f233 /numpy/polynomial/polynomial.py
parent0402e1c6a5cc5693a1f021446f20baebe9073890 (diff)
downloadnumpy-894d93e98c6b35037829dc4f78fd86245becb7ff.tar.gz
DOC: Clarify the column order of 2-D and 3-D Vandermonde matrices.
Diffstat (limited to 'numpy/polynomial/polynomial.py')
-rw-r--r--numpy/polynomial/polynomial.py32
1 files changed, 20 insertions, 12 deletions
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py
index 01197af12..9c8c077f0 100644
--- a/numpy/polynomial/polynomial.py
+++ b/numpy/polynomial/polynomial.py
@@ -1078,12 +1078,16 @@ def polyvander2d(x, y, deg) :
`V` index the points `(x, y)` and the last index encodes the powers of
`x` and `y`.
- If `c` is a 2-D array of coefficients of shape `(m + 1, n + 1)` and `V`
- is the matrix ``V = polyvander2d(x, y, [m, n])``, then
- ``np.dot(V, c.flat)`` and ``polyval2d(x, y, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 2-D polynomials of the same
- degrees and sample points.
+ If ``V = polyvander2d(x, y, [xdeg, ydeg])``, then the columns of `V`
+ correspond to the elements of a 2-D coefficient array `c` of shape
+ (xdeg + 1, ydeg + 1) in the order
+
+ .. math:: c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ...
+
+ and ``np.dot(V, c.flat)`` and ``polyval2d(x, y, c)`` will be the same
+ up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 2-D polynomials
+ of the same degrees and sample points.
Parameters
----------
@@ -1135,12 +1139,16 @@ def polyvander3d(x, y, z, deg) :
indices of `V` index the points `(x, y, z)` and the last index encodes
the powers of `x`, `y`, and `z`.
- If `c` is a 3-D array of coefficients of shape `(l + 1, m + 1, n + 1)`
- and `V` is the matrix ``V = polyvander3d(x, y, z, [l, m, n])``, then
- ``np.dot(V, c.flat)`` and ``polyval3d(x, y, z, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 3-D polynomials of the same
- degrees and sample points.
+ If ``V = polyvander3d(x, y, z, [xdeg, ydeg, zdeg])``, then the columns
+ of `V` correspond to the elements of a 3-D coefficient array `c` of
+ shape (xdeg + 1, ydeg + 1, zdeg + 1) in the order
+
+ .. math:: c_{000}, c_{001}, c_{002},... , c_{010}, c_{011}, c_{012},...
+
+ and ``np.dot(V, c.flat)`` and ``polyval3d(x, y, z, c)`` will be the
+ same up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 3-D polynomials
+ of the same degrees and sample points.
Parameters
----------