Construct income distributions from parameters knowledge

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.

回答(1 个)

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 个评论

Yes but imagine i created a distribution using lognpdf and x=[0:100:500000]. Matlab will return values of the pdf at 100,200,300 and so on. If i want the number of people under 455 how can i do this? First of all, theoretically, this should be the definite integral of the PDF with bounds [0,455] but my data is not continuous and the PDF does not take into account the underlying population size.
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.
Fine. Sure, i understand. The last problem is about the "aggregation". If i have two PDFs created with lognpdf(x,mu,sigma) say one for China and one for India, the aggregated density will be the population weighted sum of the subgroup densities right? So i create
china=lognpdf(x,mu,sigma)*china_population
india=lognpdf(x,mu,sigma)*india_population
china_india=china+india
% to obtain the aggregated density
If i want obtain the number of people below 455 of this aggregated? I cannot use the stragegy logncdf because i do not know the "parameters" in this case because it will not be a lognormal anymore.
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.
The convolution should not be appropriate in my case since if X and Y are two random variables, then the convolution theorem will help me to find the distribution of X+Y and not f(X) + f(Y) if i am not mistaken.
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.

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by