# LearnDistribution Vs FindDistribution?

How would you explain the difference between the new LearnDistribution function and the FindDistribution function? or perhaps the overall ML vs Find framework.

I would think for a sample size of 1000 the following code would produce a consistent histogram. But that isn't the case... why is that?

obj = RandomReal[100, 1000];

ld = LearnDistribution@obj
fd = FindDistribution@obj

obj2 = Table[RandomVariate /@ {ld, fd}, 100];
Histogram[obj2[[;; , 1]], PlotRange -> All]
Histogram[obj2[[;; , 2]], PlotRange -> All]


• There are (at least) four issues: (1) One shouldn't expect very similar histograms even sampling from the same distribution with just a 100 samples - and those two samples are completely independent of each other. (2) LearnDistribution seems to end up with a SmoothKernelDistribution which seems to have too small of a default bandwidth resulting in a bumpier distribution, and (3) Because you've chosen a bounded distribution, the default for SmoothKernelDistribution doesn't use the "Bounded" option, and (4) LearnedDistribution is experimental: your mileage may vary. – JimB Jul 6 at 4:15
• Also the difference shows up from the PDF's of the estimated distributions. There's no need to generate histograms: 'Plot[{PDF[ld, x], PDF[fd, x]}, {x, -20, 120}]. – JimB Jul 6 at 4:20