ll
multi-normal, otherwise we model the marginal distribution of the
component that is observed.</p>
<pre><code>for (n in 1:N) {
  if (y_observed[n, 1] &amp;&amp; y_observed[n, 2])
    y[n] ~ multi_normal(mu, Sigma);
  else if (y_observed[n, 1])
    y[n, 1] ~ normal(mu[1], sqrt(Sigma[1, 1]));
  else if (y_observed[n, 2])
    y[n, 2] ~ normal(mu[2], sqrt(Sigma[2, 2]));
}</code></pre>
<p>It’s a bit more work, but much more efficient to vectorize these
sampling statements. In transformed data, build up three