Hello,
I’m using the following model with one class. I would like to integrate mixture parameters to isolate specific groups.
Would you have an idea of how to change the code below so that it includes groups parameters?
Similar problematic is available here: Mixture Bernoulli
model <- "
data {
int<lower=0> n; // number of subjects
int<lower=0> k; // number of items
int<lower=0, upper=1> y1[n]; // manifestation variables
int<lower=0, upper=1> y2[n];
int<lower=0, upper=1> y3[n];
int<lower=0, upper=1> y4[n];
int<lower=0, upper=1> y5[n];
int<lower=0, upper=1> y6[n];
int<lower=0, upper=1> y7[n];
int<lower=0, upper=1> y8[n];
}
parameters {
vector[k] alpha;
real<lower=0> beta[k];
vector[n] x; // this is theta but its easier to see as x in the code
}
model {
// priors
x ~ normal(0,1);
alpha ~ normal(0,4);
beta ~ gamma(4,3);
// items
y1 ~ bernoulli_logit(alpha[1] + beta[1] * x);
y2 ~ bernoulli_logit(alpha[2] + beta[2] * x);
y3 ~ bernoulli_logit(alpha[3] + beta[3] * x);
y4 ~ bernoulli_logit(alpha[4] + beta[4] * x);
y5 ~ bernoulli_logit(alpha[5] + beta[5] * x);
y6 ~ bernoulli_logit(alpha[6] + beta[6] * x);
y7 ~ bernoulli_logit(alpha[7] + beta[7] * x);
y8 ~ bernoulli_logit(alpha[8] + beta[8] * x);
}
"