Andrew Gelman
unread,May 7, 2015, 9:38:59 AM5/7/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to stan...@googlegroups.com
Hi all. I was talking with Sebastian about fitting mixture of multivariate normals—it comes up for our hierarchical EP algorithm. Basically what we’re looking for is a little program that automatically does this, probably an R function that calls Stan. Here are the two challenges:
1. Avoiding degenerate solutions where one mixture component has zero variance.
2. Handling the aliasing, which requires identifying which mixture is which.
My idea is as follows:
1. Using a default weakly informative prior that constrains the relative values of the variances. I’m not sure how best to do this. A fairly lightweight (from a statistical perspective) approach would be to put a prior on the determinants of the cov matrix, but I’m not sure how to easily do this in Stan so that it wouldn’t be computationally expensive. Another approach would be to use one of our existing models such as inv-Wishart or LKJ with some hyperparameter that itself has a proper prior. Really there are three concerns here: first is the very basic issue of the prior constraining things to be away from the boundary; second is, if we are using a hierarchical model here, this could improve the fit by regularizing the cov matrices (under the reasonable assumption that they’re likely to be of comparable scale; third is that we want the whole thing to run fast so we want to avoid models that are expensive to evaluate.
2. How to handle the aliasing? In 1-d it’s simple enough because you can just constrain the means of the mixture components to be ordered: mU_1 < mu_2 < mu_3 etc. We could do the same in higher dimensions, using for example the first dimension and constraining those means to be increasing—but this could cause problems, for example, if there are 2 components whose means are close in dimension 1 but far apart in dimension 2. So here’s another idea: We first attempt to locate the K components using some crude algorithm such as nearest neighbor, so that we get K points in D-dimensional space. We then identify the model based on the distance of the modes from these points. I’m still not exactly sure how to do this: if K=2 it’s easy, we could just constrain the two modes based on the difference of the distances between the 2 points. (Actually, I’m not sure if it’s so easy to apply that constraint in Stan.) In higher dimensions it would be easier to use a soft constraint that penalizes each mode based on its distance from the crude mode. But that’s kinda sloppy because then we’re using the data twice and not quite fitting the model we want to fit.
The other issue is that we’d like the program to do full Bayes or optimize. I’m hoping that running stan on optimize setting will be easier in the new rstan that’s coming soon? I don’t like that “optimizing” function; I’d rather either call stan() with an optimize=TRUE setting or have a function called stan_optimize(). Also I would like the optimization to work with the stan() function that we have at that web-location, the version that has the make-like behavior.
Anyway, if we’re optimizing, things are simpler. We still have to deal with issue 1 above, but issue 2 is less of a concern because we can just pick any starting point and then it should find one of the modes.
See you
A