interpolation-0.1.1.2: piecewise linear and cubic Hermite interpolation
Safe HaskellSafe-Inferred
LanguageHaskell98

Numeric.Interpolation.Basis

Description

Generate lists of basis functions with respect to interpolation nodes and generate functions from coefficients with respect to these bases.

A basis function is one where all but one features are zero. E.g. in a linear basis a basis function is one at one node, and zero at all the other interpolation nodes.

You need the basis functions for setting up the matrix for a linear least-squares solver for curve fitting. The solver computes some coefficients and in a second step you convert these coefficients to the piecewise interpolation function.

Synopsis

Interpolation basis functions

linear :: Num b => [a] -> [T a b] Source #

hermite1 :: Num b => [a] -> [T a (b, b)] Source #

cubicLinear :: Fractional a => [a] -> [T a (a, a)] Source #

Cubic interpolation where the derivative at a node is set to the slope of the two adjacent nodes.

cubicParabola :: Fractional a => [a] -> [T a (a, a)] Source #

Cubic interpolation where the derivative at a node is set to the slope of the parabola through the current and the two adjacent nodes.

Construct functions from the coefficients with respect to a basis

coefficientsToLinear :: [a] -> [b] -> T a b Source #

coefficientsToLinear nodes coefficients creates an interpolation function for nodes, where the coefficients correspond to the basis functions constructed with Basis.linear nodes.