Below is my model, however, when I run it, always showed that

## Cannot assign to variable outside of declaration block; left-hand-side variable origin=parameter

error in ‘model49df3845277a_simulation_v4’ at line 24, column 13

```
22: target += log(normal_cdf( x1[n] , alpha, sigma) - normal_cdf( x2[n] , alpha, sigma)); // interval censored titer
23: for (n in 1:N)
24: theta[n] = inv_logit(b_0 + b_titer * x1[n]); // infection rate
^
25: for (n in 1:N)
```

PARSER EXPECTED:

Error in stanc(file = file, model_code = model_code, model_name = model_name, :

failed to parse Stan model ‘simulation_v4’ due to the above error.

data {

int<lower=0> N;

real<lower=0> x1[N];

real<lower=0> x2[N];

int<lower=0,upper=1> output[N];

}

parameters {

real alpha;

real<lower=0> sigma;

real theta;

real b_0;

real b_titer;

}

model {

alpha ~ normal(0,10);

sigma ~ cauchy(0,10);

theta ~ cauchy(0,10);

b_0 ~ cauchy(0,10);

b_titer ~ cauchy(0,10);

for (n in 1:N)

target += log(normal_cdf( x1r[n] , alpha, sigma) - normal_cdf( x2[n] , alpha, sigma));

for (n in 1:N)

theta[n] = inv_logit(b_0 + b_titer * x1[n]);

for (n in 1:N)

target += bernoulli_lpmf(output[n] | theta[n]);

print(alpha, sigma, theta, b_0, b_titer);

}