I am new to Stan, and I’ve been attempting to fit a model having a Beta-distributed parameter, which provides the mean of a truncated Gaussian likelihood. The model has random intercepts for “participants” for the mean of the Beta, and I’ve attempted to use non-centered parameterizations of priors wherever possible.
I’m wondering if it’s possible to do something similar for the likelihood, though. Including the Beta-distributed parameter theta_v_verb
causes warnings - specifically related to high Rhat and ESS - so I’m wondering if there’s a way to get rid of it. (I’ve determined this by just having a Beta likelihood, instead, which works okay.) Thanks to anyone in advance!
parameters {
vector[N_verb] mu_v;
vector[N_verb] nu_v;
real<lower=0> tau_participant_mu;
vector[N_participant] z_participant_mu;
vector<lower=0, upper=1>[N_verb_data] theta_v_verb;
real<lower=0> sigma_jitter;
}
transformed parameters {
vector<lower=0, upper=1>[N_verb_data] mu_v_verb;
vector<lower=0>[N_verb_data] nu_v_verb;
vector<lower=0>[N_verb_data] alpha_v_verb;
vector<lower=0>[N_verb_data] beta_v_verb;
vector[N_participant] epsilon_participant_mu;
epsilon_participant_mu = tau_participant_mu * z_participant_mu;
for (i in 1:N_verb_data) {
mu_v_verb[i] = inv_logit(mu_v[verb_v[i]] + epsilon_participant_mu[participant_v[i]]);
nu_v_verb[i] = exp(nu_v[verb_v[i]]);
}
alpha_v_verb = mu_v_verb .* nu_v_verb;
beta_v_verb = (1 - mu_v_verb) .* nu_v_verb;
}
model {
mu_v ~ normal(0, 1);
nu_v ~ normal(0, 1);
theta_v_verb ~ beta(alpha_v_verb, beta_v_verb);
for (i in 1:N_verb_data) {
y_v[i] ~ normal(theta_v_verb[i], sigma_jitter) T[0, 1]; // likelihood
}
}
sigma_jitter ~ exponential(20);
}