# How to find the shape parameters of of a beta distribution given the position of two quantiles?

## How to find the shape parameters of of a beta distribution given the position of two quantiles?

I am trying to find $$\alpha$$ and $$\beta$$ the shape parameters of a beta distribution.

I know that my distribution has a median at $$\frac{1}{10}$$ and a 90th percentile at $$\frac{1}{2}$$.

# Attempt

Solve[{
{α, β}]


Solve gets stuck. I have also tried NSolve.

If you are fine with a numerical approximation of the values, FindRoot is the function you'll want to use:

sol = FindRoot[
Quantile[BetaDistribution[Exp[a], Exp[b]], {1/2, 9/10}] == {1/10, 1/2},
{
{a, 0},
{b, 0}
}
]


{a -> -0.787898, b -> 0.717402}

In these equations I used Exp[a] and Exp[b], because those are always positive so FindRoot will never accidentally try illegal parameters of the BetaDistribution.

You could also try to "come close", e.g. minimize total quadratic error:

sol = NMinimize[
{
Plus[
(Quantile[BetaDistribution[α, β ], 1/2] - 1/10 )^2 ,