TLDR: Feel free to download or make a copy of this Sheets to calculate the parameters of uniform, normal, loguniform, lognormal, pareto and logistic distributions (including the mean and median), based on the values of 2 quantiles.
Scenario
Given a random variable X with cumulative distribution functionF, and two values x1 and x2 respecting the quantiles F(x1) and F(x2), what are the parameters of the underlying distribution? Answering this question is relevant to determine the expected value (mean) of X.
As a concrete example, X could represent the cost-effectiveness distribution of an intervention whose 10th and 90th percentiles are 5 and 15. For this case, the inputs would be:
x1=5 and x2=15.
F(x1)=0.1 and F(x2)=0.9.
Distribution parameters
The relationship between the values and quantiles of X is described by:
Feel free to download or make a copy of this Sheets to calculate the parameters of uniform, normal, loguniform, lognormal, pareto and logistic distributions, based on the above formulas. I have also included formulas for the mean and median for all these distributions.
The standard normal distribution has mean 0, and standard deviation 1. The quantile function is the inverse of the cumulative distribution function. The quantile function of the normal distribution could be calculated via NORMINV in Sheets, and scipy.stats.norm.ppf in Python.
How to determine distribution parameters from quantiles
TLDR: Feel free to download or make a copy of this Sheets to calculate the parameters of uniform, normal, loguniform, lognormal, pareto and logistic distributions (including the mean and median), based on the values of 2 quantiles.
Scenario
Given a random variable X with cumulative distribution function F, and two values x1 and x2 respecting the quantiles F(x1) and F(x2), what are the parameters of the underlying distribution? Answering this question is relevant to determine the expected value (mean) of X.
As a concrete example, X could represent the cost-effectiveness distribution of an intervention whose 10th and 90th percentiles are 5 and 15. For this case, the inputs would be:
x1=5 and x2=15.
F(x1)=0.1 and F(x2)=0.9.
Distribution parameters
The relationship between the values and quantiles of X is described by:
For a uniform distribution with minimum a and maximum b:
F(x)=(x−a)/(b−a);a≤x≤b.
For a normal distribution with mean μ and standard deviation σ, denoting as Q the quantile function of the standard normal distribution[1]:
Q(F(x))=(x−μ)/σ.
For a pareto distribution with minimum xm and tail index α:
F(x)=1−(xmx)α;x≥xm.
For a logistic distribution with mean μ and scale s:
F(x)=(1+e−x−μs)−1.
The parameters which define the distributions could be determined solving a system of 2 equations for each of the above relationships:
For a uniform distribution:
a=F(x2)x1−F(x1)x2F(x2)−F(x1).
b=(1−F(x1))x2−(1−F(x2))x1F(x2)−F(x1).
For a normal distribution:
μ=Q(F(x2))x1−Q(F(x1))x2Q(F(x2))−Q(F(x1)).
σ=x2−x1Q(F(x2))−Q(F(x1)).
For a loguniform or lognormal distribution:
lnX follows a uniform or normal distribution.
This means the parameters referring to the logarithm of X could be calculated replacing x1 and x2 by lnx1 and lnx2.
For a pareto distribution:
α=ln(1−F(x1))−ln(1−F(x2))lnx2−lnx1.
xm=x1(1−F(x1))1α.
For a logistic distribution:
μ=ln(1F(x1)−1)x2−ln(1F(x2)−1)x1ln(1F(x1)−1)−ln(1F(x2)−1).
s=x2−x1ln(1F(x1)−1)−ln(1F(x2)−1).
Feel free to download or make a copy of this Sheets to calculate the parameters of uniform, normal, loguniform, lognormal, pareto and logistic distributions, based on the above formulas. I have also included formulas for the mean and median for all these distributions.
The standard normal distribution has mean 0, and standard deviation 1. The quantile function is the inverse of the cumulative distribution function. The quantile function of the normal distribution could be calculated via NORMINV in Sheets, and scipy.stats.norm.ppf in Python.