# How to exclude MixtureDistribution from FindDistribution

is there a way to exclude MixtureDistribution from the set of fitted distributions when using FindDistribution?

I expected that TargetFunctions option within FindDistribution would resolve this, however MixtureDistribution still comes up as a proposed candidate - though the component distributions within the proposed MixtureDistribution are indeed restricted to those listed in TargetFunctions.

Cheers,

td

I am not aware of a method to exclude MixtureDistribution from FindDistribution. However, if you want to test individual distributions to your data then you may use EstimatedDistribution. This function does not return any statistics on the fit but you can use DistributionFitTest on its result to test for goodness of fit.

If there is some data,

dist = MixtureDistribution[{.7, .3},
{ParetoDistribution[500, 20, 0], HalfNormalDistribution[.25]}];
SeedRandom[789];
data = RandomVariate[dist, 1000];


That results in a MixtureDistribution where you wish to exclude this form.

FindDistribution[data,
TargetFunctions -> {InverseGaussianDistribution,
HalfNormalDistribution, LevyDistribution, LogNormalDistribution}]

MixtureDistribution[{0.866903, 0.133097},
{LogNormalDistribution[1.95719, 1.43364],
LogNormalDistribution[3.82415, 0.414689]}]


Then map EstimateDistribution and DistributionFitTest over the distributions

htd = DistributionFitTest[data, EstimatedDistribution[data, #], "HypothesisTestData"] & /@
{InverseGaussianDistribution[a, b],
HalfNormalDistribution[a],
LevyDistribution[a, b],
LogNormalDistribution[a, b]}


Goodness of fit statistics are available in each HypothesisTestData object. Use this information to select the best fit.

fitted = First@MaximalBy[Select[#["PValue"] >= 0.05 &]@htd, #["PValue"] &, 1];
fitted["TestConclusion"]
fitted["FittedDistribution"]

The null hypothesis that the data is distributed according to the
LogNormalDistribution[2.16635,1.39778] is not rejected at the 5 percent level
based on the Cramér-von Mises test.

LogNormalDistribution[2.16635, 1.39778]


Additional fitted properties are listed with fitted["Properties"].

Hope this helps.

• I should really read the docs better. I'd never seen DistributionFitTest before, but have wanted it at many points in time. Commented Aug 6, 2017 at 5:41
• Hi Edmund that does help - thanks for the work around. Commented Aug 14, 2017 at 10:38