If I generate some data using
data = RandomVariate[NormalDistribution[5, 3], 100]
Then find the distribution using
(1) FindDistribution[data]
Mathematica gives me an estimated distribution (correctly guesses a Normal) and values of that distributions parameters.
However, if I then do
(2) EstimatedDistribution[data, NormalDistribution[a, b]]
or
(3) FindDistributionParameters[data, NormalDistribution[a, b]]
Mathematica gives me different "best fit" parameter estimates. Using defaults, (2) and (3) give the same results, and (1) gives different results.
Looking at the documentation it looks like (2) and (3) might use a different method by default to (1). But I have been unable to get (1) to give the same results as (2) and (3). Is there a simple way (options) to make the results consistent.
A couple of more general questions:
Are there any "rules" as to when one should use (1), versus (2) or (3) to get parameter values. Obviously (1) finds a distribution, versus (2) and (3) finding best fit parameters of a specified distribution.
The three functions seem very related, so it seems confusing that by default they did not give the same best fit parameters.
FindDistribution[data,PerformanceGoal->"Quality",TargetFunctions-> {NormalDistribution}]
gives the same solution as other methods but notFindDistribution[data,PerformanceGoal->"Quality",TargetFunctions-> {NormalDistribution, WeibullDistribution}]
. $\endgroup$FindDistribution
makes most sense only when you are exploring different hypotheses on what could be the underlying distribution, but not as the means to extract parameters of known distributions. However, given that there is a bug in that function, I would say it does not make sense to useFindDistribution
at all until the scope of the bug is understood or fixed. $\endgroup$RandomSeeding[{1, 2, 3, 4}]; data = RandomVariate[NormalDistribution[5, 3], 200];FindDistribution[data, PerformanceGoal -> "Quality", TargetFunctions -> {NormalDistribution, WeibullDistribution}]
results inNormalDistribution[5.36896, 3.09436]
, whehereasFindDistributionParameters[data, NormalDistribution[a, b]]
performs{a -> 5.36618, b -> 3.00919}
. It should be noticed thatFindDistribution
is sensitive to a sample size. Don't hesitate to ask for further explanation in need. PS. A very similar result with with the size =150. $\endgroup$TargetFunctions
. Circumventing a bug by tweaking options obviously doesn't give information about that bug, and does not constitute an answer to the question at hand, IMHO. $\endgroup$