mono - Freeform - Monotonic Spline¶
Monotonic cubic hermite interpolation. |
|
Computes the cubic hermite polynomial \(p(x_t)\). |
|
Count the number of inflection points in a curve. |
|
Plot inflection points in a curve. |
Monotonic spline modeling.
- bumps.mono.hermite(x, y, m, xt)[source]¶
Computes the cubic hermite polynomial \(p(x_t)\).
The polynomial goes through all points \((x_i,y_i)\) with slope \(m_i\) at the point.
- 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.