[SciPy-Dev] legendre regression

Charles R Harris charlesr.harris at gmail.com
Mon Jan 31 13:43:19 EST 2011


On Mon, Jan 31, 2011 at 11:25 AM, Yaroslav Halchenko
<lists at onerussian.com>wrote:

> Switching to scipy (0.8.0) + numpy (1.5.1) from scipy (0.7.2) + numpy
> (1.4.1) reveals regression:
>
> *(Pdb) print legendre(1)(N.array([-0.999999999999 , -0.6, -0.2,  0.2,  0.6,
>  1. ]))
> [-1.  -0.6 -0.2  0.2  0.6  1. ]
>
> *(Pdb) print legendre(1)(N.array([-1 , -0.6, -0.2,  0.2,  0.6,  1. ]))
> [ inf -0.6 -0.2  0.2  0.6  1. ]
>
> while before it was giving correct boundary value (-1).
>
> Could anyone please check if it is still present in current HEAD?  imho
> worth a bugreport  (haven't ran into similar one upon query but decided to
> check -- may be it was resolved already).
>
>
You might also be interested in the Legendre polynomial series in Numpy.

In [1]: from numpy.polynomial import Legendre as L

In [2]: p = L([0,1])

In [3]: p([-1 , -0.6, -0.2,  0.2,  0.6,  1. ])
Out[3]: array([-1. , -0.6, -0.2,  0.2,  0.6,  1. ])

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20110131/402d86a4/attachment.html>


More information about the SciPy-Dev mailing list