gt; ii_obs[N_obs];
  int&lt;lower = 1, upper = N_obs + N_mis&gt; ii_mis[N_mis];
  real y_obs[N_obs];
}
transformed data {
  int&lt;lower = 0&gt; N = N_obs + N_mis;
}
parameters {
  real y_mis[N_mis];
  real&lt;lower=0&gt; sigma;
}
transformed parameters {
  real y[N];
  y[ii_obs] = y_obs;
  y[ii_mis] = y_mis;
}
model {
  sigma ~ gamma(1, 1);
  y[1] ~ normal(0, 100);
  y[2:N] ~ normal(y[1:(N - 1)], sigma);
}</code></pre>
<p>The index arrays <code>ii_obs</code> and <code>ii_mis</code> contain the indexes into