0

If given a 95% CI with lower and upper bound, and the mean. The mean is not centered in the CI. How to calculate apha beta in Beta Distribution?

wayne goos
  • 11
  • 1
  • 1
    (Seems you may be trying to pick a Bayesian prior. If so maybe exact parameters are not necessary.) Estimate μ as CI center and and σ as about 1/4 the CI length, then use [this Q&A](https://stats.stackexchange.com/questions/12232/calculating-the-parameters-of-a-beta-distribution-using-the-mean-and-variance). At the start, if you have any idea of the shape of the distribution, fudge μ in the direction of any skewness. Take quantiles .025 and .975 of resulting beta dist'n. If they roughly match the original CI, you're done. If not, iterate. ). – BruceET May 29 '21 at 06:57
  • so we can just guess and give a rough prior, instead of a theoretical one? @BruceET – wayne goos May 30 '21 at 14:17
  • Depends on the situation. If this is a class exercise, you may be expected to give a nearly exact answer. In consulting practice trying to get a client to provide info to convert his beliefs or prior knowledge into a prior is almost never an exact process. Whatever prior you use, you should assess its effect on the posterior/ Maybe by contrasting the posterior from one resulting from a relatively non-informative prior. // If you have enough data the influence of any reasonable prior tends to be less. – BruceET May 30 '21 at 15:35

1 Answers1

0

As suggested by BruceET, you can turn your problem into an optimization.

Let's consider that the beta parameters were $\alpha=2, \beta=4$, so $\mu = 1/3$ and the theoretical 95% CI is around $[0.052,0.716]$. Your problem is only having the statistics, and you want to find the parameters.

mu <- 0.3333
ci <- c(0.052,0.716)

We can define a cost function with only parameter $\alpha$ (since $\beta$ can the computed because we know the mean).

get.beta <- function(alpha) {
  alpha * (1-mu)/mu
}

quantiles <- c(0.025, 0.975)

cost <- function(alpha) {
  qs <- qbeta(quantiles, alpha, get.beta(alpha))
  sum(abs(qs-ci))
}

Now just call optim

opt <- optim(1, cost, method="BFGS")
estimated.alpha <- opt$par
estimated.beta  <- get.beta(estimated.alpha)
estimated.ci    <- qbeta(quantiles, estimated.alpha, estimated.beta)

In my simulation I got $\alpha=2.003$ and $\beta=4.008$, quite similar to the initial values that produced the target ci.

jpneto
  • 722
  • 1
  • 5
  • 13