Function to Create a Smooth, Monotonically Non-Decreasing Curve Between Three Points

curves

I am working on a tutoring system. When a student first starts we set the mastery threshold at A and they also have to have done at least a questions. But most students won't achieve that standard – after a student has done b questions we will lower the threshold to B. Finally we set a lower threshold, at c questions where the student only has to achieve a mastery of C. The thresholds remains at C past c questions.

My (poor) attempt at drawing this in paint is below. I need to extrapolate good values between the points. I'd like the curve to be smooth (smooth higher order derivatives are nice, but not necessary) and monotonically non-decreasing.

Bonus points I would like a gradient of 0 at the point (c, C) so that it smoothly joins with the straight line. But this isn't strictly necessary if it will greatly complicate the function.

I know that we should be able to fit a cubic equation to those three points, but I don't believe this would always guarantee the monotonically decreasing property, nor would we be able to get a gradient of 0 at the end

enter image description here

Best Answer

If I understand it correctly you want a smooth function $f\colon [a,+\infty)\to \mathbb R$ such that $f(a) = A$, $f(b)=B$ and $f(x)=C$ for all $x\ge c$. Moreover you want the function to be decreasing (we need $C<B<A$).

Since $f$ is required to be constant on some interval, the function cannot be analytical, hence it must be defined piecewise.

A possibility is: $$ f(x) = \begin{cases} C+(A-C)\exp\left(\beta\frac{x-a}{c-x}\right) & \text{if $x<c$} \\ C & \text{if $x\ge c$} \end{cases} $$ with $\beta = \frac{c-b}{b-a} \log\frac{B-C}{A-C}$.

Related Question