I'm new to both stan
and brms
, and having trouble extracting posterior predictive distributions. Let's say I have a simple logistic regression
fit = brm(y ~ x, family="bernoulli", data=df.training)
where y
is binary and x
continuous. For test data (or even the training data), I thought I could now get hold of the predictive distribution for the bernoulli probability p
, by altering probs
in
predict(fit, df.test, probs=seq(0, 1, 0.1))
However, while the output from this command gives me estimates that are continuous in the range [0,1]
(this makes sense), the confidence interval values seem to be binary (this does not make sense to me)... How do I get the entire posterior predictive distribution for p
?
This question is obviously a long time ago. But I stumbled upon it and think it resonates with my own questions.
Based on my experiment on a logistic regression model I think below is true for the default inputs:
posterior_linpred
gave the continuous linear scale;fitted
gave the continuous probability scale between 0 and 1;predict
gave the binary [0,1] scale predictions I don't have a Beta-Binomial model (to me, it is a good example of logistic with over-dispersion) at hand to test what the result of the posterior_linpred
would be, but I am confident that the fitted
and predict
would be on the outcome scale.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With