问题描述
我通过从R运行Winbug进行了贝叶斯分析,并得出了拟合值及其贝叶斯间隔.这是相关的Winbugs输出,其中mu [i]是第i个拟合值.
I conducted a Bayesian analysis by running Winbugs from R and derived the fitted values and their Bayesian intervals. Here is the related Winbugs output where mu[i] is the i-th fitted value.
node mean 2.5% 97.5%
mu[1] 0.7699 0.6661 0.94
mu[2] 0.8293 0.4727 1.022
mu[3] 0.7768 0.4252 0.9707
mu[4] 0.6369 0.4199 0.8254
mu[5] 0.7704 0.5054 1.023
我想做的是找到这5个拟合值的平均值的贝叶斯区间.知道如何吗?
What I want to do is to find the Bayesian interval for the mean of these 5 fitted values. Any idea how?
推荐答案
克里斯·杰克逊(Chris Jackson)的回答是正确的,但是,如果您的模型已经运行了几个小时,您将不满意,因为这意味着修改模型并运行再来一次.但是您可以在后处理中实现R的目标,而无需再次运行模型-通过取后验样本的平均值:
The answer of Chris Jackson is correct, however, if your model has been running for hours, you will not be happy, because it means modifying the model and running it again. But you can achieve your goal in R in the post-process without running the model again - by taking mean of the posterior samples:
out <- bugs(...)
sapply(out$sims.list$mu, mean, ...) # I'm not sure exactly about the structure of
# out$sims.list$mu, so it might be slightly
# different
这篇关于5个拟合值的贝叶斯间隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!