官术网_书友最值得收藏!

Credible intervals for proportions

Bayesian statistics doesn't use confidence intervals but credible intervals instead. We specify a probability, and that will be the probability that the parameter of interest lies in the credible interval. For example, there's a 95% chance that θ lies in its 95% credible interval. We compute credible intervals by computing the quantiles from the posterior distribution of the parameter, so that the chosen proportion of the posterior distribution lies between these two quantiles.

So, I've already gone ahead and written a function that will compute credible intervals for you. You give this function the number of successes, the total sample size, the first argument of the prior and the second argument of the prior, and the credibility (or chance of containing θ) of the interval. You can see the entire function as follows:

So, here is the function; I've already written it so that it works for you. We can use this function to compute credible intervals for our data.

So, we have a 95% credible interval based on the uninformative prior, as follows:

Therefore, we believe that θ will be between 25% and 30%, with a 95% probability.

The next one is the same interval when we have a different priorthat is, the one that we actually used before and is the one that we plotted:

The data hasn't changed very much, but still, this is going to be our credible interval.

The last one is the credible interval when we increase the level of credibility to .99 or the probability of containing the true parameter:

Since this probability is higher, this must be a longer interval, which is exactly what we see, although it's not that much longer.

主站蜘蛛池模板: 崇明县| 庆安县| 安徽省| 南通市| 武川县| 化德县| 斗六市| 慈利县| 建宁县| 金溪县| 长沙县| 临海市| 黄浦区| 怀仁县| 隆尧县| 雷波县| 闸北区| 南川市| 沙雅县| 丰顺县| 宁武县| 尤溪县| 济南市| 喜德县| 勐海县| 怀柔区| 昆山市| 岳阳市| 江源县| 金溪县| 商城县| 广安市| 温宿县| 博客| 天镇县| 田阳县| 自贡市| 丹江口市| 开江县| 日照市| 钦州市|