Beta distribution. The pdf
> rbeta(n,alpha,beta)generates independent random sample from the beta distribution.
Bayes estimate. When the uninformative prior , the posterior density is give by , and the expected value of is calculated as
Explore it. Download bernoulli.r. The function bernoulli() generates data, and compares the estimates of two distinct methods. See how they differ in a particular outcome, and repeat the experiment with the same size. Increase the size, and observe the similarity of the two estimate.
> source("bernoulli.r") > bernoulli() > bernoulli(size=20)
© TTU Mathematics