splrep#

swordfish.function.splrep()#

splrep, short for Spline Representation, is used to find the B-spline representation of a one-dimensional curve. With a given set of data points (x[i], y[i]), it determines the degree-3 smooth spline approximation over the interval x[0] <= x <= x[size(x)-1]. If null value is included in the input values of x, y, or t, it will be filled with 0.

Parameters:
  • X (Constant) – A vector of Integral/Temporal/Floating/Decimal type that define the data points for the cubic spline curve y = f(x).

  • Y (Constant) – A vector of Integral/Temporal/Floating/Decimal type that define the data points for the cubic spline curve y = f(x).

  • t (Constant, optional) –

    A vector indicating the knots needed. Splines can have different polynomials on either side of the knots, by default DFLT.

    The values in t must satisfy the Schoenberg-Whitney conditions, meaning there must exist a subset of data points x[j] for all j=0, 1,…,n-5 such that t[j] < x[j] < t[j+4].

Returns:

A tuple of length 3 containing the vector of knots, the B-spline coefficients, and the degree of the spline.

Return type:

Constant