mono - Freeform - Monotonic Spline¶
monospline |
Monotonic cubic hermite interpolation. |
hermite |
Computes the cubic hermite polynomial \(p(x_t)\). |
count_inflections |
Count the number of inflection points in a curve. |
plot_inflections |
Plot inflection points in a curve. |
Monotonic spline modeling.
-
bumps.mono.
monospline
(x, y, xt)[source]¶ Monotonic cubic hermite interpolation.
Returns \(p(x_t)\) where \(p(x_i)= y_i\) and \(p(x) \leq p(x_i)\) if \(y_i \leq y_{i+1}\) for all \(y_i\). Also works for decreasing values \(y\), resulting in decreasing \(p(x)\). If \(y\) is not monotonic, then \(p(x)\) may peak higher than any \(y\), so this function is not suitable for a strict constraint on the interpolated function when \(y\) values are unconstrained.