# Non-decreasing (monotonic) parameter vector

Hi,

is there a good way to get a non-decreasing (monotonic) parameter vector in Stan? The ordered vector class only gives an increasing (monotone) vector.

Thanks

1 Like

If the vector is to be used as cut points in ordered logistic regression (a main use of the type) the equality doesn’t make much sense. In addition the ordered vector is log-transformed to unconstrained space which falls apart if the neighboring entries are equal. Besides in floating point world “equality” is often an illusion.

1 Like

When the parameter is continuous, the probability that it exactly takes any particular value is zero (i.e. it’s infinitesimal). Or rather, if it took any exact value with finite probability then the gradient of the posterior wouldn’t exist and Stan would break anyway. Thus, there is no important difference between allowing equality and disallowing equality. If you run into the limits of floating point, where differences that you cannot represent in floating point are important, then you have bigger problems than your inability to have the parameters be exactly equal. And note that the transformation used to put the ordered type on the unconstrained scale actually has extremely high precision near the lower bounds anyway.

1 Like

Thanks, that helps me a lot, I will just use the ordered vector then.