Description Usage Arguments Value Examples
update_prior
uses the equation for the posterior:
φ(λ | R; N,P) = Pr(R|λ; N,P) φ(λ) / \int Pr(R | λ'; N,P) φ(λ') d λ'
where φ is the prior and Pr(R | λ; N, P) is the probability of R reports of heads given that people lie with probability λ:
Pr(R | λ; N, P) = binom(N, (1-P) + λ P)
1 | update_prior(heads, N, P, prior = stats::dunif, npoints = 1000)
|
heads |
Number of good outcomes reported |
N |
Total number in sample |
P |
Probability of bad outcome |
prior |
Prior over lambda. A function which takes a vector of values between 0 and 1, and returns the probability density. The default is the uniform distribution. |
npoints |
How many points to integrate on? |
The probability density of the posterior distribution, as a one-argument function.
1 2 | posterior <- update_prior(heads = 30, N = 50, P = 0.5, prior = stats::dunif)
plot(posterior)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.