For a Monte Carlo simulation where each sample can produce a success value (1) or a failure value (0), what is the variance of the probability for success?
Given n samples and r successes, the estimated probability for a success is $\frac{r}{n}$. What is the variance of the probability for a success?
Managed to solve this. This is a Bernoulli process. The number of trials needed to get r has a negative binomial distribution NB(r, p): $\mu_{n}=\frac{r}{p} ; \sigma_{n}=\frac{r(1-p)}{p^{2}}$
Extracting p and propagating the error, we get: $p=\frac{r}{\mu_{n}} ; \sigma_{p}=\frac{p^{2}(1-p)}{r}$