numpy.polynomial.laguerre.lagval

numpy.polynomial.laguerre.lagval(x, cs)

Evaluate a Laguerre series.

If cs is of length n, this function returns :

p(x) = cs[0]*P_0(x) + cs[1]*P_1(x) + ... + cs[n-1]*P_{n-1}(x)

If x is a sequence or array then p(x) will have the same shape as x. If r is a ring_like object that supports multiplication and addition by the values in cs, then an object of the same type is returned.

Parameters :

x : array_like, ring_like

Array of numbers or objects that support multiplication and addition with themselves and with the elements of cs.

cs : array_like

1-d array of Laguerre coefficients ordered from low to high.

Returns :

values : ndarray, ring_like

If the return is an ndarray then it has the same shape as x.

See also

lagfit

Notes

The evaluation uses Clenshaw recursion, aka synthetic division.

Examples

>>> from numpy.polynomial.laguerre import lagval
>>> coef = [1,2,3]
>>> lagval(1, coef)
-0.5
>>> lagval([[1,2],[3,4]], coef)
array([[-0.5, -4. ],
       [-4.5, -2. ]])

Previous topic

numpy.polynomial.laguerre.Laguerre.truncate

This Page