Hello,
I’m fitting a mixture model of two skew-normal distributions with brms. Everything is working well, but I’m confused that the priors listed when I call get_prior()
don’t seem to match the priors I see when I call make_stancode()
. I’m sure that I’m misunderstanding or missing something, and I would really appreciate any help.
My main question is why, after predicting the mixing proportions by predicting theta2, theta1 shows up as something that I can put a prior on. I understand that in this case, I’m can only place the prior on the proportion of theta2
. When I call make_stancode()
on the same model without specifying priors, it only lists a prior on the theta2 like this: target += logistic_lpdf(Intercept_theta2 | 0, 1);
, and I see no prior on theta1. This makes sense to me, so I guess I’m just trying to understand the difference for my own sanity.
I can generate an example data-set if it is required to answer my question, but here is the output of the two functions. First, the call and output of get_prior()
:
get_prior(bf(sIntDiff_HC ~
slFreq +
(slFreq||Subject) +
(1|word_label),
theta2 ~
slFreq +
(slFreq||Subject) +
(1|word_label)),
data = hc_clean,
family = skew_skew_mixture)
prior class coef group resp dpar nlpar bound source
normal(0, 4) alpha1 default
normal(0, 4) alpha2 default
student_t(3, 0, 2.5) sigma1 default
student_t(3, 0, 2.5) sigma2 default
logistic(0, 1) theta1 default
(flat) b mu1 default
(flat) b slFreq mu1 (vectorized)
student_t(3, -0.2, 2.5) Intercept mu1 default
student_t(3, 0, 2.5) sd mu1 default
student_t(3, 0, 2.5) sd Subject mu1 (vectorized)
student_t(3, 0, 2.5) sd Intercept Subject mu1 (vectorized)
student_t(3, 0, 2.5) sd slFreq Subject mu1 (vectorized)
student_t(3, 0, 2.5) sd word_label mu1 (vectorized)
student_t(3, 0, 2.5) sd Intercept word_label mu1 (vectorized)
(flat) b mu2 default
(flat) b slFreq mu2 (vectorized)
student_t(3, -0.2, 2.5) Intercept mu2 default
student_t(3, 0, 2.5) sd mu2 default
student_t(3, 0, 2.5) sd Subject mu2 (vectorized)
student_t(3, 0, 2.5) sd Intercept Subject mu2 (vectorized)
student_t(3, 0, 2.5) sd slFreq Subject mu2 (vectorized)
student_t(3, 0, 2.5) sd word_label mu2 (vectorized)
student_t(3, 0, 2.5) sd Intercept word_label mu2 (vectorized)
(flat) b theta2 default
(flat) b slFreq theta2 (vectorized)
logistic(0, 1) Intercept theta2 default
student_t(3, 0, 2.5) sd theta2 default
student_t(3, 0, 2.5) sd Subject theta2 (vectorized)
student_t(3, 0, 2.5) sd Intercept Subject theta2 (vectorized)
student_t(3, 0, 2.5) sd slFreq Subject theta2 (vectorized)
student_t(3, 0, 2.5) sd word_label theta2 (vectorized)
student_t(3, 0, 2.5) sd Intercept word_label theta2 (vectorized)
And now the call and output of make_stancode()
, I’ve only included the section listing the priors:
make_stancode(bf(sIntDiff_HC ~
slFreq +
(slFreq||Subject) +
(1|word_label),
theta2 ~
slFreq +
(slFreq||Subject) +
(1|word_label)),
data = hc_clean,
family = skew_skew_mixture)
// priors including constants
target += student_t_lpdf(Intercept_mu1 | 3, -0.2, 2.5);
target += student_t_lpdf(sigma1 | 3, 0, 2.5);
target += normal_lpdf(alpha1 | 0, 4);
target += student_t_lpdf(Intercept_mu2 | 3, -0.2, 2.5);
target += student_t_lpdf(sigma2 | 3, 0, 2.5);
target += normal_lpdf(alpha2 | 0, 4);
target += logistic_lpdf(Intercept_theta2 | 0, 1);
target += student_t_lpdf(sd_1 | 3, 0, 2.5)
- 2 * student_t_lccdf(0 | 3, 0, 2.5);
target += std_normal_lpdf(z_1[1]);
target += std_normal_lpdf(z_1[2]);
target += student_t_lpdf(sd_2 | 3, 0, 2.5)
- 1 * student_t_lccdf(0 | 3, 0, 2.5);
target += std_normal_lpdf(z_2[1]);
target += student_t_lpdf(sd_3 | 3, 0, 2.5)
- 2 * student_t_lccdf(0 | 3, 0, 2.5);
target += std_normal_lpdf(z_3[1]);
target += std_normal_lpdf(z_3[2]);
target += student_t_lpdf(sd_4 | 3, 0, 2.5)
- 1 * student_t_lccdf(0 | 3, 0, 2.5);
target += std_normal_lpdf(z_4[1]);
target += student_t_lpdf(sd_5 | 3, 0, 2.5)
- 2 * student_t_lccdf(0 | 3, 0, 2.5);
target += std_normal_lpdf(z_5[1]);
target += std_normal_lpdf(z_5[2]);
target += student_t_lpdf(sd_6 | 3, 0, 2.5)
- 1 * student_t_lccdf(0 | 3, 0, 2.5);
target += std_normal_lpdf(z_6[1]);
}