I want to extract the distribution parameters for a set of data. I know what the distribution is. However, I find that for different sets or even subsets of this data the values of the extracted distribution using FindDistributionParameters[Data, Distribution]
fluctuate quite a lot.
To test this I made a small simulation:
TestData = RandomVariate[WeibullDistribution[84.2, 366.9, -494.9], 10000];
TestDistParams =
{αW, βW, γW} /.
FindDistributionParameters[
TestData,
WeibullDistribution[αW, βW, γW],
{{αW, 84.2}, {βW, 366.9}, {γW, -494.9}}]
Show[
{Histogram[TestData, {"Raw", Round[Sqrt[Length[TestData]]]}],
Plot[
PDF[WeibullDistribution[TestDistParams[[1]], TestDistParams[[2]], TestDistParams[[3]]]][x],
{x, -160, -115}]}]
What I find is that the output of FindDistributionParameters[..]
fluctuates quite a lot, sometimes the extracted parameters are twice as large as those input into generating the test distribution -- sometimes more so. This is even case when simulating with a large sample (10000 points) and when initialising FindDistributionParameters
with guesses exactly as that used to generate the distribution.
What I have found to be far more robust is actually just finding the values of the centre bins with the corresponding PDF value or count, and using NonlinearModelFit
to this.
What is the best approach of accurately extracting distribution parameters from a data set, reliably and accurately? Can one use constraints in a similar way to fitting?
On the advice of an experience user, I am adding a specific example. If I use a fixed set of random numbers with SeedRandom[123456]
Using the same code as above I get for SeedRandom[123456] --> {148.383, 653.1, -781.061}
. This one is so bad that the plotted PDF is just completely off.
or if I choose another seed, say SeedRandom[851] --> 5.54576*10^6, 2.41777*10^7, -2.41778*10^7
Both examples are for a sample set of 10000 points.
To rephrase my question a little more carefully
My question specifically relates to dealing with FindDistributionParameters
when the results are clearly too far off to be considered as part of normal statistical fluctuation (see above examples with fixed seeds) but when the data itself definitely reflects the distribution one is trying to match to it. I.e. when it is specifically drawn from that distribution. Are there constraints one can use for example?
FinDistributionParameters
? Assuming Wolfram knows something of statistics, and likelihood evaluations. I am asking specifically why my current approach/use of Mathematica functions doesn't give sensible results. $\endgroup$FindDistributionParameters
shows that decision was made by someone only vaguely familiar with the subject of Statistics. $\endgroup$