Generation of large data sets (10^4) for log Pearson type III distribution and finding its paramters

Dear All, I have a data set which is log pearson type III distributed fitted. Using that data how can I find the parameters associated with that distribution. further using that paramters I have to generate more number of samples. That samples which I have generated should overlap twith the data given below. Can anyone please help me with this I am working on this from a long time.
Q PDF(LP3)
14.162562 0.000011
28.325123 0.000723
31.403941 0.001391
33.866995 0.002169
36.945813 0.002904
39.408867 0.003638
41.871921 0.004439
45.566502 0.005262
49.261084 0.006063
53.571429 0.006875
59.729064 0.007632
70.197044 0.008288
89.901478 0.007654
100.369458 0.006875
113.300493 0.005996
125.000000 0.005173
137.315271 0.004350
150.862069 0.003571
167.487685 0.002815
192.118227 0.002025
225.985222 0.001246
275.246305 0.000679
326.970443 0.000345
370.073892 0.000211
418.103448 0.000133
459.359606 0.000089
500 5.56242E-05

4 Comments

Dear All, I have a data set which is log pearson type III distributed fitted. Using that data how can I find the parameters associated with that distribution.
So you assume that your data follow the log pearson type III distribution and you want to find the parameters of this distribution ?
Maybe you could include a link on how the distribution with its parameters looks like.
No, actually this data surely fits log pearson type 3 distribution. I have digitized this data from a research article. If you can plot it Q vs PDF it will show you.

Sign in to comment.

 Accepted Answer

If the distribution you have in mind is the same one described here then this is a good problem for Cupid (see especially the file DemoLogPearsonIII.m).
% Initialize distribution information
Q = [14.162562, 28.325123, 31.403941, 33.866995, 36.945813, 39.408867, 41.871921, 45.566502, 49.261084, 53.571429, 59.729064, 70.197044, 89.901478, 100.369458, 113.300493, 125.000000, 137.315271, 150.862069, 167.487685, 192.118227, 225.985222, 275.246305, 326.970443, 370.073892, 418.103448, 459.359606, 500];
PDF = [0.000011, 0.000723, 0.001391, 0.002169, 0.002904, 0.003638, 0.004439, 0.005262, 0.00606, 0.006875, 0.007632, 0.008288, 0.007654, 0.006875, 0.005996, 0.005173, 0.004350, 0.003571, 0.002815, 0.002025, 0.001246, 0.000679, 0.000345, 0.000211, 0.000133, 0.000089, 5.56242E-05];
% Create a starting LogPearsonIII distribution with initial guesses
% for the parameters (which will be estimated later):
GammaShape = 5;
GammaRate = 5;
ShiftConst = 2;
% RNGamma, AddTrans, and ExpTrans are all parts of Cupid
startGamma = RNGamma(GammaShape,GammaRate);
% Shift the gamma by adding in a constant. The resulting distribution
% is a Pearson III distribution:
PearsonIII = AddTrans(startGamma,ShiftConst);
% The Log-Pearson III is a distribution whose log is Pearson III.
% That means that the Log-Pearson III distribution is an
% exponential transformation of the original PearsonIII.
% So, we can make the desired Log-Pearson III by using the Exp transform:
LogPearsonIII = ExpTrans(PearsonIII);
% LogPearsonIII is now a distribution object with the starting guesses for the parameter estimates.
% Next estimate the distribution's parameters by trying to match the PDF values at the Q points:
LogPearsonIII.EstDensity(Q,PDF);
% Print the estimated parameter values:
LogPearsonIII.ParmValues
% ans =
% 26.803 8.8801 1.6729
% Display the PDF and CDF of the estimated distribution
LogPearsonIII.PlotDens;
% Generate 1000 random numbers from the fitted distribution:
randlp = LogPearsonIII.Random(1000,1);
% Compare the histogram of the random numbers with the PDF originally specified.
figure;
histogram(randlp,'normalization','pdf');
hold on
plot(Q,PDF);
% You can also generate the random numbers like this:
randlp2 = exp( gamrnd(26.803,1/8.8801,1000,1)+1.6729 );

5 Comments

Thanks Jeff Miller for you valuable comment. Yes this is the same distribution that you attached here and it is used for prediction of floods. Earlier I was having problem with RNGamma. Than I downloaded cupid file and installed it in matlab. Now an error is coming while running this code in matlab can you suggest something how I can reduce this error and run this code. So that I can have a look what is the final repsonse of this code.
Unrecognized method, property, or field 'EstDensity' for class 'ExpTrans'.
Error in Jeffmilerresponse (line 21)
LogPearsonIII.EstDensity(Q,PDF);
Hi Raj Arora,
I guess you installed Cupid with the Cupid.mltbx file -- sorry, I have not kept mltbx completely up to date.
Here is one shortcut that might work: go back to GitHub, download the newest file dGeneric.m, and use it to replace the older version of the file that was installed from mltbx. Then try the script again.
If that doesn't work you will probably have to download the whole project from GitHub instead of using the mltbx file, or just wait for me to update mltbx tomorrow.
Yes Jeff, I have downloaded the Cupid.mltbx file. Ok let me try with this dGeneric.m I will let you know whether I am able to proceed or not.
Thankyou very much Jeff for sharing this valuable information and time I was stuck on this problem from a long time. I downloaded the entire project form Github and now I pasted your code in that folder and your code is running smooothly. Finallly I am able to see the final aspect which seems to me totally correct.
Thankyou Jeff once again.
You are welcome, Raj. I am glad that Cupid was useful to you.

Sign in to comment.

More Answers (0)

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!