[英]posterior predictive distribution from brms (logistic regression)
I'm new to both stan
and brms
, and having trouble extracting posterior predictive distributions. 我是stan
和brms
,在提取后验预测分布时遇到麻烦。 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. 其中y
是二进制的, x
连续的。 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 对于测试数据(甚至是训练数据),我想我现在可以得到的伯努利概率的预测分布保持p
,通过改变probs
在
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
? 但是,尽管此命令的输出为我提供了在[0,1]
范围内连续的估计值(这很有意义),但置信区间值似乎是二进制的(对我而言这没有意义)...我得到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; posterior_linpred
给出连续的线性比例; fitted
gave the continuous probability scale between 0 and 1; fitted
给出0到1之间的连续概率标度; predict
gave the binary [0,1] scale predictions predict
提供了二进制[0,1]规模预测 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. 我手边没有Beta-Binomial模型(对我来说,这是过度分散的逻辑模型的一个很好的例子)来测试posterior_linpred
的结果是什么,但是我相信fitted
和predict
将是在结果量表上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.