{ } Raw JSON

bundles / scipy latest / scipy / interpolate / _bsplines / _make_periodic_spline

function

scipy.interpolate._bsplines:_make_periodic_spline

source: /scipy/interpolate/_bsplines.py :1321

Signature

def   _make_periodic_spline ( x y t k axis * xp )

Summary

Compute the (coefficients of) interpolating B-spline with periodic boundary conditions.

Parameters

x : array_like, shape (n,)

Abscissas.

y : array_like, shape (n,)

Ordinates.

k : int

B-spline degree.

t : array_like, shape (n + 2 * k,).

Knots taken on a circle, k on the left and k on the right of the vector x.

Returns

b : `BSpline` object

A BSpline object of the degree k and with knots t.

Notes

The original system is formed by n + k - 1 equations where the first k - 1 of them stand for the k - 1 derivatives continuity on the edges while the other equations correspond to an interpolating case (matching all the input points). Due to a special form of knot vector, it can be proved that in the original system the first and last k coefficients of a spline function are the same, respectively. It follows from the fact that all k - 1 derivatives are equal term by term at ends and that the matrix of the original system of linear equations is non-degenerate. So, we can reduce the number of equations to n - 1 (first k - 1 equations could be reduced). Another trick of this implementation is cyclic shift of values of B-splines due to equality of k unknown coefficients. With this we can receive matrix of the system with upper right and lower left blocks, and k diagonals. It allows to use Woodbury formula to optimize the computations.

Aliases

  • scipy.interpolate._bsplines._make_periodic_spline