Bayesian interval of 5 fitted values

落花浮王杯 提交于 2019-12-12 22:04:00

问题


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   

What I want to do is to find the Bayesian interval for the mean of these 5 fitted values. Any idea how?


回答1:


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



回答2:


Define another node in the WinBUGS model code

mu.mean <- mean(mu[])

and monitor it?



来源:https://stackoverflow.com/questions/14257482/bayesian-interval-of-5-fitted-values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!