The sampling distribution: $$p(y_i|\theta, \lambda) = \lambda_1 f(y_i|\theta_1) + ...+ \lambda_H f(y_i|\theta_H)$$
LogSumExp: $$\log p(y_i|\theta, \lambda) = \log (\lambda_1 \exp (\log f(y_i|\theta_1)) + ... $$ $$+ \lambda_H \exp(\log f(y_i|\theta_H)))$$
For each $i$:
How many componentst?
Dataset http://www.stat.columbia.edu/~gelman/book/data/schiz.asc
for j in patients: $\alpha \sim \mathcal{N}(\mu, \sigma^2_\alpha)$ if $x_j$: # schizophrenic for i in trials: $z \sim \mathrm{Bernoulli}(\lambda)$ if $z$: # lack of attention $y_{ij} \sim \mathcal{N}(\alpha + \beta + \tau, \sigma^2_y)$ else: $y_{ij} \sim \mathcal{N}(\alpha + \beta, \sigma^2_y)$ else: for i in trials: $y_{ij} \sim \mathcal{N}(\alpha, \sigma^2_y)$