File:Runge's phenomenon in Lagrange polynomials.svg

X=5,6,9,11 Y=12,13,14,16

Summary

Description
English: The polynomial interpolation of samples taken from a Gaussian distribution displays significant ringing near the endpoints.
Date
Source Own work
Author Glosser.ca
SVG development
InfoField
 
The SVG code is valid.
 
This diagram was created with Mathematica.
Category:Valid SVG created with Mathematica code:Diagrams#Runge's%20phenomenon%20in%20Lagrange%20polynomials.svg
 
The file size of this SVG diagram may be irrationally large because its text has been converted to paths inhibiting translations.
Category:Path text SVG
Source code
InfoField

Mathematica code

dat = {#, Exp[-#^2/2]} & /@ Range[-5, 5];
{xs, ys} = Transpose[dat];

Basis[pts_, x_] := Times @@ (x - DeleteCases[pts, #])/Times @@ (# - DeleteCases[pts, #]) & /@ pts

f = Total[ys*Basis[xs, x]];

Plot[
 {
  Exp[-x^2/2],
  f
  }, {x, -5, 5},
 Epilog -> {PointSize[Large], Point[dat]},
 PlotRange -> All,
 PlotStyle -> Thick,
 Frame -> True,
 FrameStyle -> Black,
 Axes -> False,
 GridLines -> Automatic,
 GridLinesStyle -> Directive[LightGray, Dashed],
 ImageSize -> Large]
but from where does the text come ?

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-4.0#Runge's%20phenomenon%20in%20Lagrange%20polynomials.svg
Category:Self-published work Category:Interpolation Category:Lagrange polynomial Category:Normal distribution
Category:CC-BY-SA-4.0 Category:Interpolation Category:Lagrange polynomial Category:Normal distribution Category:Path text SVG Category:Self-published work Category:Valid SVG created with Mathematica code:Diagrams