numpy.polynomial.laguerre.lagfromroots

numpy.polynomial.laguerre.lagfromroots(roots)

Generate a Laguerre series with the given roots.

Return the array of coefficients for the P-series whose roots (a.k.a. “zeros”) are given by roots. The returned array of coefficients is ordered from lowest order “term” to highest, and zeros of multiplicity greater than one must be included in roots a number of times equal to their multiplicity (e.g., if 2 is a root of multiplicity three, then [2,2,2] must be in roots).

Parameters :

roots : array_like

Sequence containing the roots.

Returns :

out : ndarray

1-d array of the Laguerre series coefficients, ordered from low to high. If all roots are real, out.dtype is a float type; otherwise, out.dtype is a complex type, even if all the coefficients in the result are real (see Examples below).

See also

polyfromroots, chebfromroots

Notes

What is returned are the c_i such that:

\sum_{i=0}^{n} c_i*P_i(x) = \prod_{i=0}^{n} (x - roots[i])

where n == len(roots) and P_i(x) is the i-th Laguerre (basis) polynomial over the domain [-1,1]. Note that, unlike polyfromroots, due to the nature of the Laguerre basis set, the above identity does not imply c_n = 1 identically (see Examples).

Examples

>>> from numpy.polynomial.laguerre import lagfromroots, lagval
>>> coef = lagfromroots((-1, 0, 1))
>>> lagval((-1, 0, 1), coef)
array([ 0.,  0.,  0.])
>>> coef = lagfromroots((-1j, 1j))
>>> lagval((-1j, 1j), coef)
array([ 0.+0.j,  0.+0.j])

Previous topic

numpy.polynomial.laguerre.lagroots

Next topic

numpy.polynomial.laguerre.lagfit

This Page