This video has beautiful graphics underpinning an especially clear explanation. At just seven minutes it doesn't get on to Runge Spikes. I'm hoping to create original content about Runge Spikes and this will be the video I link to, to explain Lagrange Interpolation
I liked the way he built up the formula, first one point, then two, then three, then the general case. I coded along at home, writing some Common Lisp, structured the same way
In the last five minutes Elliot Nicholson warns that Lagrange Interpolation sometimes wiggles weirdly in between the given points. That is the Runge Spikes thing that I'm interested in.
I thought that I could generate a simple example by running my code. Let the points be (0,0), (1,0), (2,1), (3,0), (4,0). I'm expecting wiggles at the half-integer points.
[ + ] WyattDonnelly
[ - ] WyattDonnelly 1 point 6 daysJan 9, 2025 17:30:44 ago (+1/-0)
https://www.youtube.com/watch?v=wbSzthGR7OU&t=1s
[ + ] happytoes
[ - ] happytoes [op] 0 points 5 daysJan 10, 2025 18:23:03 ago (+0/-0)
https://pastebin.com/GY1YZUGz
In the last five minutes Elliot Nicholson warns that Lagrange Interpolation sometimes wiggles weirdly in between the given points. That is the Runge Spikes thing that I'm interested in.
I thought that I could generate a simple example by running my code. Let the points be (0,0), (1,0), (2,1), (3,0), (4,0). I'm expecting wiggles at the half-integer points.
CL-USER> (funcall (make-poly '((0 . 0)(1 . 0)(2 . 1)(3 . 0)(4 . 0))) 2.5) => 0.703125
That is reasonable
CL-USER> (funcall (make-poly '((0 . 0)(1 . 0)(2 . 1)(3 . 0)(4 . 0))) 3.5) => -0.546875
That little dip is odd, but not too weird.
But if I try interpolating 0 0 0 0 0 1 0 0 0 0 0
CL-USER> (funcall (make-poly '((0 . 0)(1 . 0)(2 . 0)(3 . 0)(4 . 0)
(5 . 1)
(6 . 0)(7 . 0)(8 . 0)(9 . 0)(10 . 0)
)) 0.5)
=> 4.9335175
I get a weird answer at one half. Yah! My first Runge Spike!
[ + ] FreeinTX
[ - ] FreeinTX 0 points 6 daysJan 9, 2025 17:17:49 ago (+0/-0)