msmjax.bspline.basis

B-spline basis function implementation

msmjax.bspline.basis.characteristic(knots, eval_point)[source]

Characteristic function chi on intervals defined by knots. chi(eval_point) evaluates to 1 for knots[t] <= eval_point < knots[t+1], 0 otherwise

Parameters:
  • knots (Array) – Array containing the positions of the knots. Have to be sorted monotonically increasing

  • eval_point (jax.typing.ArrayLike) – Point to evaluate the characteristic basis at

Return type:

Array

Returns:

Array containing characteristic function evaluation chi(eval_point) on each interval. Array is of length len(knots) - 1

msmjax.bspline.basis.evaluate_basis_element(knots, eval_point)[source]

Evaluate the B-spline basis on the reference interval defined by knots using the recursive definition by de Boor. The order of the basis element is given by len(knots) - 2. For more information: “A Practical Guide to Splines”, C. de Boor, Springer, 2001.

Parameters:
  • knots (Array) – Array containing the positions of the knots. Array has to be sorted monotonically increasing

  • eval_point (jax.typing.ArrayLike) – Point to evaluate the B-spline basis at

Return type:

Array

Returns:

B-spline basis evaluation for the given reference interval

msmjax.bspline.basis.create_bspline_basis_element(order=3)[source]

Wrapper to create a B-spline basis element of given order centered at 0

Parameters:

order (int) – Order of the spline, has to be greater or equal to 1. Defines the reference interval [-(order + 1) / 2, (order + 1) / 2]

Return type:

Callable[[jax.typing.ArrayLike], Array]

Returns:

Function that takes the point on the reference interval as input and returns the evaluation of the B-spline basis at that point