update_prior {truelies} | R Documentation |
Calculate posterior distribution of the proportion of liars
Description
update_prior
uses the equation for the posterior:
where is the prior and
is the
probability of R reports of heads given that people lie with probability
:
Usage
update_prior(heads, N, P, prior = stats::dunif, npoints = 1000)
Arguments
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? |
Value
The probability density of the posterior distribution, as a one-argument function.
Examples
posterior <- update_prior(heads = 30, N = 50, P = 0.5, prior = stats::dunif)
plot(posterior)
[Package truelies version 0.2.0 Index]