Finite Mixture Vectorization

Stan user manual says that vectorization is not supported for finite mixtures: Finite Mixtures

Compare the following two models:

model{
for (n in 1:N) {
  target += log_mix(lambda,
                    normal_lpdf(y[n] | mu[1], sigma[1]),
                    normal_lpdf(y[n] | mu[2], sigma[2]));
  }
}

and

model{
target += log_mix(lambda,
                  normal_lpdf(y | mu[1], sigma[1]),
                  normal_lpdf(y | mu[2], sigma[2]));
}

Given that log_mix was vectorized in 2.26, does the second model still lead to the assumption that the sequence of y_{1}, y_{2}, ... y_{N} comes from the same component or does the vectorization of log_mix allow elements of \mathbf{y} to come from different components?

Thanks in advance!

Hi

Not sure what you mean with the same component. This is only vectorization, making the code faster computationally. The model in both cases perform the same task and should yield the same answer