These parameters aren’t identified. I want to marginalize out u
to see if that helps because it helped in an earlier problem I had. Is that doable here, in the more discrete model?
data {
int<lower=0> N;
int<lower=1> K;
int y[N];
int kk[N];
}
parameters {
vector[N] u;
real<lower=0> mu[K];
real<lower=0> sigma;
real<lower=0> offset[K];
vector[K] g0;
}
transformed parameters {
real beta[K];
for (k in 1:K) {
beta[k] = offset[k] * sigma + mu[k];
}
}
model {
mu ~ normal(1, 3);
sigma ~ normal(1,1);
to_vector(g0) ~ normal(0,3);
to_vector(u) ~ normal(0,1);
for (n in 1:N) {
kk[n] ~ categorical_logit(u[n]*g0);
y[n] ~ bernoulli_logit(u[n]*beta[kk[n]]);
}
}