# Bug in PDF with EmpiricalDistribution?

The PDF applied to EmpiricalDistribution of a set of real plots as zero. Given:

points = {0.360656, 0.459016, 0.557377, 0.540984, 0.786885, 0.42623, 0.344262, 0.57377, 0.42623, 0.459016};


Then:

points // EmpiricalDistribution //
Query[{Plot[CDF[#, x], {x, 0, 1}] & , Plot[PDF[#, x], {x, 0, 1}] &}]


Whereas for example HistogramDistribution works:

points // HistogramDistribution //
Query[{Plot[CDF[#, x], {x, 0, 1}] & , Plot[PDF[#, x], {x, 0, 1}] &}]


Known issue or expected behavior due to the discrete set of points? I've also tried with ~10k points with the same result. One would expect delta spikes located at the input points.

I don't find it a bug. Let us go into deep:

points = {0.360656, 0.459016, 0.557377, 0.540984, 0.786885, 0.42623,0.344262, 0.57377,
0.42623, 0.459016};
pdf = PDF[EmpiricalDistribution[points], x]


0.1 Boole[0.344262 == x] + 0.1 Boole[0.360656 == x] + 0.2 Boole[0.42623 == x] + 0.2 Boole[0.459016 == x] + 0.1 Boole[0.540984 == x] + 0.1 Boole[0.557377 == x] + 0.1 Boole[0.57377 == x] + 0.1 Boole[0.786885 == x]

In order to draw it, DiscretePlot instead of Plot should be used.

DiscretePlot[pdf, {x, points}]


• With Frame -> True, PlotRange -> {{Min@points, Max@points}, {0, 0.2}}, PlotRangePadding -> 0.05, the plot is much more informative. – corey979 May 12 '18 at 21:44