- Training Systems Using Python Statistical Modeling
- Curtis Miller
- 289字
- 2021-06-24 14:20:47
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 prior—that 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.
- SPSS數據挖掘與案例分析應用實踐
- 算法基礎:打開程序設計之門
- oreilly精品圖書:軟件開發者路線圖叢書(共8冊)
- Python高級機器學習
- 零基礎學MQL:基于EA的自動化交易編程
- Hands-On RESTful Web Services with Go
- SAS數據統計分析與編程實踐
- Julia高性能科學計算(第2版)
- Microsoft 365 Certified Fundamentals MS-900 Exam Guide
- Julia High Performance(Second Edition)
- Mastering Concurrency in Python
- Python+Office:輕松實現Python辦公自動化
- Java高手是怎樣煉成的:原理、方法與實踐
- 零基礎學Java第2版
- 基于MATLAB的控制系統仿真及應用