dynode.utils.splines.conditional_knots

dynode.utils.splines.conditional_knots#

dynode.utils.splines.conditional_knots(t: Array | ndarray | bool | number | bool | int | float | complex, knots: Array, coefficients: Array) Array#

Evaluate knots of a spline.

Evaluates combination of an indicator variable and the coefficient associated with that knot.

Executes the following equation: sum_{i}^{len(knots)}(coefficients[i] * (t - knots[i])^3 * I(t > knots[i])) where I() is an indicator variable.

Parameters#

tjax.ArrayLike

Simulation day.

knotsjax.Array

Knot locations to compare with t.

coefficientsjax.Array

Knot coefficients to multiply each knot with, assuming it is active at some timestep t.

Returns#

jax.Array

Resulting values summed over the last dimension of the matrices.