Suppose I have a biased coin (heads with probability p), and I keep flipping it until I get t tails. So I had to flip n times in total to get t tails. How do I find a (frequentist) confidence interval for the probability of heads p?
If you are looking for ML estimation (which may or may not be what you want) please check the
fitdistr function in the
R. This function can estimate the unknown parameters using ML estimation. But please be careful about the parametrization of the negative binomial distribution of
MASS. Apart from estimating the unknown parameters, it gives the confidence intervals for the estimates.