{ } Raw JSON

bundles / scipy latest / scipy / interpolate / _dierckx / _coloc_nd

built-in

scipy.interpolate._dierckx:_coloc_nd

Summary

Construct the N-D tensor product collocation matrix as a CSR array.

Extended Summary

In the dense representation, each row of the collocation matrix corresponds to a data point and contains non-zero b-spline basis functions which are non-zero at this data point.

Parameters

xvals : ndarray, shape(size, ndim)

Data points. xvals[j, :] gives the j-th data point as an ndim-dimensional array.

t : tuple of 1D arrays, length-ndim

Tuple of knot vectors

k : ndarray, shape (ndim,)

Spline degrees

Returns

: csr_data, csr_indices, csr_indptr

The collocation matrix in the CSR array format.

Notes

Algorithm: given xvals and the tuple of knots t, we construct a tensor product spline, i.e. a linear combination of

B(x1; i1, t1) * B(x2; i2, t2) * ... * B(xN; iN, tN)

Here B(x; i, t) is the i-th b-spline defined by the knot vector t evaluated at x.

Since B functions are localized, for each point (x1, ..., xN) we loop over the dimensions, and - find the location in the knot array, t[i] <= x < t[i+1], - compute all non-zero B values - place these values into the relevant row

In the dense representation, the collocation matrix would have had a row per data point, and each row has the values of the basis elements (i.e., tensor products of B-splines) evaluated at this data point. Since the matrix is very sparse (has size = len(x)**ndim, with only (k+1)**ndim non-zero elements per row), we construct it in the CSR format.

Aliases

  • scipy.interpolate._dierckx._coloc_nd