1

I am trying to find a procedure to fit data monotonically in Python.

The data won’t be necessarily monotonic but the fit must be because of theoretical assumptions: so the signal must be monotonic but the measurements are taken with noise.

I imagine that a way of doing that would be to run an isotonic regression and then interpolate using a cubic spline. Are there easier alternatives?

In R, for example; I would use the cobs package for constrained splines. Does anything similar exists in Python?

Other ways of achieving the same result would also be fine if effective (e.g. fitting curves on monotonic transformations of the data that would maintain the overall shape of the relationship). I already know there are ways of achieving a similar result with GBM but I am looking for an alternative.

Thank you

Eaglez
  • 55
  • 1
  • 7
  • 1
    See [scipy's PchipInterpolator a.k.a. pchip](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.PchipInterpolator.html) – JohanC Feb 21 '21 at 12:37

0 Answers0