Let $S \sim \text{Bin}(N, \pi)$ denote a number of successes. Using the non-informative $\text{Beta}(0.5, 0.5)$ prior, the posterior distribution of the probability of success is $$ \text{Beta}(0.5 + S, \, 0.5 + N - S) $$
Say that the interest is in the posterior probability that $\pi > 0.60$, i.e.
$$ \text{Pr}\big(\text{Beta}(0.5 + S, \, 0.5 + N - S) > 0.60\Big) $$
The R
function f()
below assumes that the true $\pi$ equals $0.8$ and computes the proportion of times, over 10000 simulations, that this posterior probability is $> 0.95$.
f <- function(N, pi=0.8)
{
S <- rbinom(n=10000, size=N, prob=pi)
proba <- 1 - pbeta(0.60, 0.5 + S, 0.5 + N - S)
mean(proba > 0.95)
}
I would expect $f$ to be an increasing function of $N$ (after all, the posterior distribution becomes increasingly concentrated around $0.80 > 0.60$ as $N$ increases).
However,
Do you have an explanation for the behaviour?