I have a regression problem in which the response variable is sometimes left-censored at a known point, but the censoring point is different for each observation. I’m using rstan as the wrapper.

I have code, largely copied from section 4.3 of the User’s Guide, for a known, unique censoring point, below.

```
data {
int<lower=0> N_obs;
int<lower=0> N_cens;
int<lower=0> K;
matrix[N_obs, K] x_obs;
matrix[N_cens, K] x_cens;
real y_obs[N_obs];
real L;
real sigma_params[2];
}
parameters {
real<upper=L> y_cens[N_cens];
vector[K] beta;
real<lower=0> sigma;
}
model {
sigma ~ lognormal(sigma_params[1], sigma_params[2]);
y_obs ~ normal(x_obs * beta, sigma);
y_cens ~ normal(x_cens * beta, sigma);
}
```

I want to change the specification of the censoring point:

```
real L[N_cens];
...
Of course, that breaks the declaration of y_cens.
Is there a way to declare vector y_cens with a known upper limit for each element? I'm guessing it can be done in a loop, but too much of a noob to know how.
Any help will be appreciated.
```