Hi!
I really enjoy all the features of the brms package!
Is there a way of constraining models fitted with brms s.t. either the parameters are estimated under the constraint that the response scale can only take values within the interval [0,100] (in virtue of being
probability ratings of the participants) or when generating posterior predictions from the fitted models?
In modelling probability ratings of the participants, I am fitting a cluster of brms models.
One might look like this:
q1 <- brm(value ~ RelevanceDVExp
+ (Relevance * DV| lfdn) + (Relevance * DV| le_nr),
data = dw_DV_exp,
prior = c(set_prior(“normal(0,10)”, class = “b”)),
cores = 4, iter = 20000,
save_all_pars = TRUE,
sample_prior = TRUE,
control=list(adapt_delta=0.99, stepsize = 0.01, max_treedepth =15))
Afterwards, I compare the models etc…, and calculate posterior predictions by:
newdata <- data.frame(DV = c(“DVa”,“DVa”,
“DVa”,“DVa”,
“DVb”,“DVb”,
“DVb”,“DVb”,
“DVc”,“DVc”,
“DVc”,“DVc”),
Relevance = c( “PO”, “PO”,
“IR”, “IR”,
“PO”, “PO”,
“IR”, “IR”,
“PO”, “PO”,
“IR”, “IR”),
Exp = c(“Exp1”, “Exp2”,
“Exp1”, “Exp2”,
“Exp1”, “Exp2”,
“Exp1”, “Exp2”,
“Exp1”, “Exp2”,
“Exp1”, “Exp2”),
lfdn = rep(146, 12))
y_rep_1 <- posterior_predict(q1, newdata, allow_new_levels = TRUE)
y_rep_1 is now a matrix containing 40000 rows with posterior predictions for the 12 conditions.
The problem is that y_rep_1 contains values within the interval [-130, 230] whereas the responses
that I am modelling are constrained to only take values within the interval [0,100].
Thanks!
Niels
Ps. this is a repost from GitHub; I can delete the thread there
- Operating System: Windows 10