Skip to content

Instantly share code, notes, and snippets.

@adamwlev
Last active January 7, 2020 20:37
Show Gist options
  • Save adamwlev/a05f9e4aa172cd0d6615c18eb1a6c219 to your computer and use it in GitHub Desktop.
Save adamwlev/a05f9e4aa172cd0d6615c18eb1a6c219 to your computer and use it in GitHub Desktop.
Natural Cubic Splines
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adamwlev
Copy link
Author

adamwlev commented Jan 7, 2020

Python implementation of Natural Cubic Splines from Elements of Statistical Learning (HTF).

Natural Cubic Splines have the restriction of being linear at the edges and therefore are better at extrapolation. This implementation uses internal Cross Validation during a fit to find the best number of degrees of freedom. Natural Cubic Splines do better than Cubic Splines especially when the number of observations is small and/or there is a significant amount of noise in the observed data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment