This comes up in IRT (Rasch) models all the time, which
are built up from exactly that structure (with an added
multiplicative invariance).
Given the vectorized multilevel density
y ~ N(alpha0 + alpha1[group1] + alpha2[group2], sigma)
I'm assuming you have something like these hierarchical priors:
alpha0 ~ normal(0, const);
alpha1 ~ normal(0, tau1);
alpha2 ~ normal(0, tau2);
The priors being centered at 0 will already weakly identify
everything, but not as strongly as if you literally force
the alpha1 and alpha2 to be centered:
alpha1[1:(K - 1)] <- alpha1_raw;
alpha1[K] <- -sum(alpha1_raw);
I wasn't sure whether Krzysztof was suggesting that, or
another common approach, which sets
alpha1[K] <- 0
alpha2[K] <- 0
The latter will force alpha0 (albeit weakly) to be the right thing
so that alpha0 + alpha1[K] + alpha2[K] is correct. This approach is also
recommended in Gelman and Hill around the discussion of ideal point models
(a kind of IRT-like voting model). But I've found it doesn't work so
well in practice if K is large.
Gelman and Hill also recommend subtracting the mean, but as
Krzysztof points out, that produces an improper posterior, so won't
work in HMC (I doubt it actually works in BUGS for the same reason, though
it'll get close because Gibbs doesn't move very fast with correlations).
The problem I often run into if the alpha2 really all should be
roughly zero is numerical, because then you're way down in the neck
of the funnel and need small movements for alpha2 and large movements
for sigma (on the unconstrained scale), thus building in a kind of
ill-conditioning for adaptation.
- Bob