## Bernoulli Trials

Consider independent Bernoulli trials with success probability . Having observed the data , we wish to estimate the parameter . In maximum likelihood methed we construct the likelihood function

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