In the plot you can see that there are some negative slopes in the fit
function. How do I make it non-decreasing?
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
There is no standard way to do this, and I can't see any straight forward way to do so, even if you set this up as a kind of constrained optimization, for example even if you were fitting a 3rd degree polynomial ax^3 + bx^2 + cx^1 + dx^0
Then you could put a constraint that the first derivative is positive or zero:
3ax^2 + 2bx^1 + cx^0 >= 0
But this would still only be a constraint at the values for x in your data set, and not for all positive(?) values for x that you seem to want it for.
Hope this helps,
James Sherman Jr.