Constraining parameters to a weird subset of R^3

When discussing sigmoids at Dose Response Model with partial pooling on maximum value I’ve found a parametrization that I am quite happy about, but it requires three parameters a,b,c that satisfy somewhat weird conditions:

0 < \min{\{a,c\}} < b < \max{\{a,c\}} \\ b^2 > ac

The best way I can implement this is:

parameters {
  real<lower=0> a;
  real<lower=0> c;
  real<lower=sqrt(a * c), upper=max({a,c})> b;

(note that the inequality \min{\{a,c\}} < b is implied by the constraints used).

The model works neatly if I enforce the order of a and c by a constraint, or if the data are informative enough to force the ordering (a,b,c here are basically directly observable in data). I suspect (though am not sure) that the main problems I have remaining are related to the non-smoothness from the max({a,c}) when the ordering of a and c changes.

Without the b^2 > ac condition, this could be a straightforward extension of the lower and upper bounded scalar constraint, but I can’t figure out how to enforce the additional limitation.

Thanks for any ideas.


@betanalpha @yuling, any ideas?

\max(a, c) has a kink along the line a = c which I think will have to be parameterized away, but not sure how to do that.


So the subset you want looks like this:

I don’t think you can get around the fact that there’s a nondifferentiable corner at a=b=c.

What are the priors on a, b and c?


Thanks for the comments. I’ll try to clarify a bit: a,b,c are values of a sigmoid function at three equidistant points (which we can noisily observe)

f(x, \beta, \alpha, k) = \frac{k}{1 + e^{-\alpha - \beta x}} ; k > 0 \\ a = f(-1,\beta, \alpha, k) \\ b = f(0,\beta, \alpha, k) \\ c = f(1,\beta, \alpha, k) \\

I currently put a lognormal prior on those, but I don’t think this is super important. So I know that there is a way to express those parameters in a smooth subset of \mathbb{R}^3 (via \alpha,\beta, k), but I know this way to express them is impractical as \alpha,\beta, k are not always constrained by the data. So my idea was that maybe there is some way to get a smooth parametrization that is still close enough to a,b,c to be actually directly informed by observed data. Maybe there is not and my quest for a sigmoid parametrization that works well needs to continue :-)

The a = b = c point is problematic in that the mapping to \alpha,\beta,k ceases to be 1:1 - if a = b = c then \beta = 0, but I can choose one of \alpha, k arbitrarily and always find a value of the other to fit. Still, varying a,b,c within those constraints is “smooth” in the sense that the implied sigmoid curve changes smoothly with the change in those parameters (including the a = b = c case - the horizontal line is exactly the limit as a,b,c become closer)