I have a relatively simple model with a multiplicative term leading to a non-identifiable “banana” shape in the posterior. In short, I have a global parameter 0\leq\alpha\leq1 and group-level parameters 0\leq\eta_i\leq1 for each of k groups. Then I generate n samples x_{ij} from a normal distribution for each group i with mean \mu_i=\alpha\eta_i and known variance \sigma^2. The Stan model is
data {
int<lower=1> n, k;
real<lower=0> sigma;
matrix[k, n] x;
}
parameters {
real<lower=0, upper=1> alpha;
vector<lower=0, upper=1>[k] eta;
}
transformed parameters {
vector<lower=0, upper=1>[k] mu = alpha * eta;
}
model {
alpha ~ beta(1, 1);
eta ~ beta(3, 3);
for (i in 1:k) {
x[i] ~ normal(mu[i], sigma);
}
}
Sampling from the posterior distribution gives a “banana” in \alpha-\eta_i space as one might expect (see left panel of figure below), including some divergences because of the nasty shape. Sampling in the \alpha-\mu_i space (see right panel) would be much nicer because the parameters \mu_i are pinned down by the data x.
Suppose we parametrise the model in terms of \alpha and \mu_i instead. Then we can readily obtain \eta_i=\mu_i/\alpha. However, for \eta_i to be in the unit interval, we require that 0\leq\mu_i\leq\alpha which doesn’t seem like a trivial constraint to impose. We could of course change variables to a variable on the unit interval and multiply by \alpha to satisfy the constraint–but that’s exactly the variable \eta_i we’re trying to get rid off.
Any ideas on how to reparameterise this model would be much appreciated. A reproducible example (using pystan) can be found in this gist.
An aside: reparameterising in terms of \eta=1/\xi for 1\leq \xi is slightly nicer because we end up with a linear correlation between \xi and \alpha (rather than a banana), but it’s still not great.