 # Varying upper bound without lower bound

Hi all,

I am working with data that may be left-censored at some varying bound.

After reading Chapter 21.4 - Vectors with varying bounds of the Stan User Guide I want to use a varying upper bound in a similar fashion.

The only example of a varying upper bound restricts each parameter to an interval (0,U)

If I wanted the bounding interval to include negative values, say (-\infty,U), as is the case if \alpha is log-transformed, would it be sensible to just drop the lower = 0 from the alpha_raw definition?

For example

data {
int N;
vector[N] U;  // upper bounds
...
parameters {
vector<upper=1>[N] alpha_raw;
...
transformed parameters {
vector[N] alpha = U .* alpha_raw;
}


I am aware another option would be to integrate out the censored values (as suggested in Chapter 4.3 - Censored Data of the Stan User Guide) but I’m not sure how well that would work in my current model.

Yes, that works when all Us are positive.
Another idea is to have upper=0 bound and add U to the raw values.

data {
int N;
vector[N] U;  // upper bounds
...
parameters {
vector<upper=0>[N] alpha_raw;
...
transformed parameters {
vector[N] alpha = U + alpha_raw;
}


Also, vectorized bounds work in the latest CmdStan (but not yet in RStan)

data {
int N;
vector[N] U;  // upper bounds
...
parameters {
vector<upper=U>[N] alpha; // upper=_ is the same shape as alpha
...

1 Like