I was thinking that an array specification might work as in
simplex[J] lambda[n];
except for the fact that J would not be the same for each i = 1, ..., n.
Is there some work-around that you can suggest? Indeed would this work:
simplex[m[i]] lambda[n];
where m[i] specifies the dimension of the ith simplex?
parameters {
vector<lower=0>[n * sum(J)] g;
...
}
model {
int pos;
pos = 1;
for (j in 1:J) {
vector[J[j]] lambda;
lambda = segment(g, pos, J[j]);
lambda = lambda / sum(lambda);
pos = pos + J[j];
// do the likelihood or whatever with lambda
}
target += gamma_lpdf(g | alpha);
}