Question

I want to generate a continuous curve based on some data, but the curve needs to satisfy some constraints:

  1. All values of the curve are on the interval [0,1]. Values outside this interval aren't interpretable.
  2. I want to specify the exact start and end values: f(1) = 1 and f(last) = 0
  3. 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?

Was it helpful?

Solution

Transform your 0-1 variable so that it is asymptotically -Inf to +Inf, then do an unconstrained smooth, then invert the transformation.

Logit, or probit or something should help. Apologies for incompleteness, but you didn't supply a reproducible example and I've got things to do.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top