Monotonic splines in brms?

Is there a way to force monotonicity upon a spline in a brms model? Due to sparsity at either end of a continuous covariate, we are seeing an up/down tick which we believe to be overfitting / bad fitting and would like to guard against. Any help would be much appreciated.


  • Operating System: Mac OS Big Sur
  • brms Version: 2.14.4

monotonicity upon a spline in a brms model

BRMS uses MGCV library for splines. Monotonicity requires sampling from a multinormal distribution with unequality constraints. Algorithms exists for this, but are not implemented in STAN yet.

Now, if we move to Gaussian processes, we have a great paper of @avehtari
and as shown in the post Curve fitting -- including convexity constraint
it is possible to do Monotonicity in Stan.
Although this road is paved by the most comfort, it is one to gain new learning experiences.