Chapter 11 Exercises
Dirichlet process mixture for eye tracking data
Solutions

Fit a Dirichlet process mixture of normal distributions to the eye tracking data from Section 11.6.

a) Firstly fit a model with the within-cluster variance of observations restricted to be the same for all clusters, and the Dirichlet process concentration parameter fixed at 1.

b) Then develop a model with different variances in each cluster. For example, use a normal hierarchical prior for the cluster log SD (as suggested in Section 10.4 of the book) with a fixed mean and a mildly informative gamma prior on the precision.

In each case, ensure that the chain for the total number of clusters (and the chains for other parameters) is well-mixing, and plot the posterior distribution of this number.

As in the Galaxy example, include a variable dens.x in the data containing values at which to estimate the density of the mixture distribution. Use Inference -> Compare -> model fit (or some other software) to plot the posterior distribution of this density, and compare to the histogram in Figure 11.6 in the book.


click arrow for the data, common to all models

a)
click arrow for model with common variance
click for posterior summary statistics and plots

b)
click arrow for model with different variances in each cluster
click for posterior summary statistics and plots