Closed ghost closed 5 years ago
Thanks for the kind words and the nice suggestion!
mixem currently uses log-pdf values implemented in log_density
since I found that to be more numerically stable. Since using log-pdfs might be counter-intuitive, I opted for 'explicit is better than implicit' in that the log_density
function on a distribution has to be called by name.
I don't see a problem with adding a bit of sugar to get the PDF of a distribution and a mixture model the way that you suggest. You could simply implement __call__
on the Distribution
base class, returning np.exp(self.log_density(x))
and then use that for a pdf
implementation instead of the current one. Fancy making a PR?
Closing for inactivity.
Hi! I am trying to get familiar with your library. It's simple but useful!
However, I have a suggestions:
You could make each distribution callable e.g.:
This way you implement a PDF feature
mixe.model.pdf(weights, distributions)
which e.g. returns the weighted linear combination of all distributions:or something like that.