How to determine distribution parameters from quantiles
By Vasco GriloπΈ @ 2022-05-30T15:20 (+23)
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 with cumulative distribution function , and two values and respecting the quantiles and , what are the parameters of the underlying distribution? Answering this question is relevant to determine the expected value (mean) of .
As a concrete example, 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:
- and .
- and .
Distribution parameters
The relationship between the values and quantiles of is described by:
- For a uniform distribution with minimum and maximum :
- For a normal distribution with mean and standard deviation , denoting as the quantile function of the standard normal distribution[1]:
- For a pareto distribution with minimum and tail index :
- For a logistic distribution with mean and scale :
- .
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:
- For a normal distribution:
- For a loguniform or lognormal distribution:
- follows a uniform or normal distribution.
- This means the parameters referring to the logarithm of could be calculated replacing and by and .
- For a pareto distribution:
- .
- .
- For a logistic distribution:
- .
- .
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.
Lorenzo @ 2022-05-30T18:38 (+10)
Useful stuff! I was working on something similar months ago and ended up eyeballing things.
I think the links to the sheets are broken though, they just link to this page
Vasco Grilo @ 2022-05-31T15:51 (+1)
Sorry, and thanks! They are working now.
MichaelDickens @ 2022-05-30T22:27 (+7)
The hyperlink on the word "this" (in both instances) is broken. I don't see how to get to the calculator.
Vasco Grilo @ 2022-05-31T15:51 (+3)
Sorry, and thanks! They are working now.
MichaelDickens @ 2022-05-31T16:04 (+3)
Thank you for this! I had been trying to solve this exact problem recently, and I wasn't sure if I was doing it right. And this spreadsheet is much more convenient than the way I was doing it.
Vasco Grilo @ 2022-05-31T17:28 (+1)
Great to know that you found it useful!