Switch _1d_analytic_plot to use an Array rather than a DiscretePDF
The _1d_analytic_plot()
function currently converts the input x
and pdf
values to a DiscretePDF
. However, DiscretePDF
(or at least the underlying scipy rv_sample
class) does indeed expect the PDF to be discrete, so that the input pdf
values add up to 1 rather than them being posterior densities from a continuous distribution. This means that if you do input posterior densities evaluated at points from a continuous distribution the plotting fails. If you instead force the input values of pdf
to add up to one (so that it's no longer properly normalised) the plot is not comparable to histogram/KDEs of the posterior.
The use of DiscretePDF
in this case doesn't actually seem necessary and can instead be replaced by using an Array
object. I have made this change in this MR.