How do I specify a constraint over the distribution of target/response variable?

Hi,

I am trying to build a model that’d ultimately be used to generate predictions for slack/buffer in a process.
For example, in a heating system, the difference between predicted temperature and actual temperature.

The problem is we would like the predicted distribution to follow process specific constraint, specifically we would like the distribution of response y such that p(y > a) ~ b in order to make sure we do not provide too much buffer.

I am at loss how to specify this model. Usually constraints over parameters can be specified as part of prior but not sure how to model this. ( I thought about specifying a hierarchal model as well but still at a loss)

Any pointers or suggestions would be welcome!

Not sure if this is what you are after, but maybe this is useful? Example notebook for truncated regression

@drbenvincent Thanks a lot. It is almost what I am looking for. instead of specifying the upper bound to truncate the distribution completely, I need to somehow fix it such that only a% of probability mass is outside y>z.
Do let me know if you have some ideas.

If you can work out that bound in advance, based on the data, then you could just set a threshold in that way. If it depends on parameters then presumably you’ll need to create a deterministic node which defines the threshold based on some calculation you make.