I was reading John Randall's wiki entry
   
http://www.jsoftware.com/jwiki/JohnRandall/FourierTransformAndPolynomialMultiplication
and I got stuck on the third paragraph where he mentions Lagrange interpolation.
I have some half remembered concepts which might be relevant, but that does
not mean that I understand what he wrote.

So, I was working through a wikipedia page on the subject
http://en.wikipedia.org/wiki/Lagrange_polynomial
and, again, I got stuck.  This time on their definition of lagrange polynomials.

First, let me define a polynomial in terms of coefficients of powers of x:
   c=: 720%!i.7

Now, for the lagrange approach, I need to pick some distinct values for x
   X=: i.#c
and, I need the corresponding Y values
   Y=: c p. X

Now, according to the definition on that wikipedia page, a lagrange basis
polynomial verb would look something like this:
   l=: - */@(-.&__ 0 _)@:%"1 -/[EMAIL PROTECTED]
   3.5 l X
_0.00488281 0.0410156 _0.170898 0.683594 0.512695 _0.0683594 0.00683594

And, the corresponding lagrange polynomial would look like this:
   L=: ({:@] +/ .* [ l [EMAIL PROTECTED])"0 2
   3.5 L X,:Y
22286.5

But I have something wrong, because:
   Y-: X L X,:Y
0

And when I examine another page describing these polynomials, like
http://mathworld.wolfram.com/LagrangeInterpolatingPolynomial.html
I see basically the same definition as was presented in the
wikipedia, so I do not think my problem is in the definition.

Can anyone help me identify where I went wrong?  I would
especially appreciate any advice on systematic approaches
to finding this kind of error, but any corrections would be
great.

Thanks,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to