I want to generate a continuous curve based on some data, but the curve needs to satisfy some constraints:
- All values of the curve are on the interval [0,1]. Values outside this interval aren't interpretable.
- I want to specify the exact start and end values: f(1) = 1 and f(last) = 0
- derivative of f(x) is always negative or 0.
The data points also follow these rules.
Right now, I'm using smooth.monotone from the fda package to fit a bspline basis created with create.bspline.basis. This works great for preserving monotonicity between knots but the resulting curve seems to venture above 1 and below 0.
Is there a way to specify points that the curve fit must go through, or an interval that the curve cannot leave?