Construct income distributions from parameters knowledge
Mostra commenti meno recenti
Hi. I need to construct income distributions for several countries. The underlying assumption is that income follows a lognormal distribution and i have values for the two parameters. Of course, each distribution comes from a different population size (say China 1371220000 individuals and so on).
I used the code:
x=[0:100:500000]
china=lognpdf(x,'mu','sigma')
but this way matlab returns the values of the PDF.
I tried creating a distribution object like
china=makedist('Lognormal','mu','sigma')
but, in this case, i do not know how to assign population sizes and make operations between objects.
Substantially, how can i create income distributions knowing the two parameters and population sizes? Once created, i need to integrate them (e.g. to see how many people are below a certain threshold) or sum them (e.g. obtain a unique distribution for Chinese + Indians) so take this into account when making suggestions.
Risposte (1)
Star Strider
il 16 Ago 2017
1 voto
I am not certain of the result you want.
One possibility would be to use the lognrnd function to create random numbers distributed according to your parameters. You can specify the size of the vectors it returns to scale with the population of each country.
The other possibility is to use the logncdf function if you want the cumulative distribution rather than the probability density that lognpdf returns.
6 Commenti
Alfonso Russo
il 16 Ago 2017
Star Strider
il 16 Ago 2017
Modificato: Star Strider
il 16 Ago 2017
The maximum of the CDF would be (or rather scale to) the population size of the country. If I understand correctly what you want to do, the number of people under 455 would be the CDF (not PDF) at 455 (that will be a value between 0 and 1) multiplied by the population of the country.
Note that the CDF does the integration you alluded to. You do not need to integrate the PDF yourself, unless you want to. Using logncdf is easier, more efficient, and probably faster.
EDIT —
To illustrate:
country = 1;
NumberUnder455(country) = logncdf(455, mu(country), sigma(country)) * population(country);
You will have created the ‘mu’, ‘sigma’ and population vectors already.
Alfonso Russo
il 16 Ago 2017
Star Strider
il 16 Ago 2017
I am lost with what you are doing. If you want the total number below 455, you must use logncdf, not lognpdf, that will instead give you the number at 455.
Once you have correctly calculated the numbers for both countries below 455, the distribution is not important. You have the estimates you want.
Combining distributions is not trivial. It requires that you convolve them and then calculate the parameters defining the convolved distribution. I refer you to the appropriate textbooks for this.
Alfonso Russo
il 16 Ago 2017
Star Strider
il 16 Ago 2017
I’m just telling you how to get the total numbers below 455 for all your countries of interest. I’ve done that.
Do whatever you believe is appropriate.
Categorie
Scopri di più su Lognormal Distribution in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!