R Tutorial: Fundamentals of Bayesian Data Analysis in R | Samples and posterior summaries

DataCamp
DataCamp
5.8 هزار بار بازدید - 5 سال پیش - Want to learn more? Take
Want to learn more? Take the full course at learn.datacamp.com/courses/fundamentals-of-bayesia… at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work. --- Hey, you just did some Bayesian data analysis! You took a Bayesian model, gave it some data, and got out the probability distribution over the underlying proportion of success for your zombie drug. In Bayesian jargon, you took a "prior probability distribution", "updated it" with data, and the result was a "posterior probability distribution". These two words, prior and posterior, are used so much in Bayesian data analysis that they are worth pointing out. A prior probability distribution is a distribution over some unknown quantity that you have before, prior to, updating it with some data. Here it would be the blue distribution. And the posterior probability distribution is what this distribution turned into after, posterior to, we updated it with data. Here it would be the last distribution at n=13. Often people drop the “probability distribution”-part and just call these priors and posteriors. So, a prior is a probability distribution that represents what the model knows before seeing the data. A posterior is a probability distribution that represents what the model knows after having seen the data. When fitting a Bayesian model, the end result is always a posterior over some quantity or parameter of interest. The posterior represents how uncertain the model is of the underlying value, and in the zombie example, the posterior was displayed as a density plot showing the location of the probability. This could be a good way of communicating the result, but we might also want to summarize it further, for example, we might want to calculate a “best guess” for what the proportion of cured zombies would be. This calculation is easier to do if the posterior is represented as a vector of samples rather than as a plot. What do I mean by this? Well, take, for example, the probability distribution over the number of sixes you would get when rolling 5 dice. You can represent that distribution as a plot, or as a mathematical function, if that’s your thing. Well, take, for example, the probability distribution over the number of sixes you would get when rolling 5 dice. You can represent that distribution as a plot, or as a mathematical function, if that’s your thing. Now, it’s actually the case that the prop_model function also returns a large random sample from the posterior distribution. So, finish off the zombie drug analysis you started in the last exercise by calculating a couple of relevant summaries using the sample returned by prop_model. #DataCamp #RTutorial #Fundamentals #Bayesian #Data #Analysis
5 سال پیش در تاریخ 1399/01/30 منتشر شده است.
5,862 بـار بازدید شده
... بیشتر