Hi,
I have a follow-up question on this model. At the moment the scale of theta
is pinned to 1 to deal with non-identifiability. This works well, even with the soft sum-to-zero constraint, and reduce_sum
helps a lot to speed this up, although I’m struggling a bit with optimizing this further via vectorization (see Using `reduce_sum` with `ordered_logistic` - #13 by saschagobel).
As a next step, I’d like to model the variance as well, so that theta
is modeled as:
The following won’t work, because scale invariance is not addressed and the model is not identified (the covariate matrix is the same for the location and scale):
theta ~ normal(X*gamma, exp(X*lambda));
In the paper mentioned above, the author suggests an additional sum-to-zero constraint on sigma, so that:
and “the geometric mean of the prior variances of the latent preferences equals one”.
I’m not sure how to implement this in Stan, though.
I tried the following but this yields a few divergent transitions, split R-hat greater than 1.05 on many parameters, and the results are clearly off.
// Just the additions
parameters {
...
vector[K] lambda;
vector<lower=0>[J] sigma;
}
model{
...
log(sigma) ~ normal(X*lambda, 1);
mean(sigma) ~ normal(0, 0.001 * J);
theta ~ normal(X*gamma, sigma);
mean(theta) ~ normal(0, 0.001 * J);
...
}
Thanks for your help!