KernelDensity.jl icon indicating copy to clipboard operation
KernelDensity.jl copied to clipboard

Make KDE a distribution and implement other Distributions method

Open matbesancon opened this issue 5 years ago • 7 comments

It would be nice to have:

  • cdf using QuadGK? Or StatsBase.ecdf?
  • quantile using cdf with bijection method

matbesancon avatar Sep 12 '18 15:09 matbesancon

I'm going to bump this thread. In addition to pdf, shouldn't other functions like mean, std, quantile, cdf, etc... be supported as well?

tbeason avatar Feb 12 '20 21:02 tbeason

Yes this sounds like an obviously good improvement.

mkborregaard avatar Jan 29 '21 10:01 mkborregaard

Yes, it would also be nice to have a rand method.

ClaudMor avatar Feb 01 '21 10:02 ClaudMor

Also loglikelihood for whoever needs to perform maximum-likelihood estimation with the resulting KDE.

Yuan-Ru-Lin avatar May 01 '23 19:05 Yuan-Ru-Lin

I was just looking at the internals of this library, checking other things and I noticed this. Unfortunately, KernelDensity.jl was not designed with such features in mind. It does not store information required to effectively calculate kernel-based features other than the pdf.

What one can do is to introduce a new interface which does store it, make a new type like KernelEstimate <: Distribution which stops one step before calculating the pdf and stores all the parameters of the fit. Perhaps it can be done even better, as I see Distributions.jl has MixtureModel implemented and kde is just a fitted mixture. I'll think about this.

jaksle avatar Jan 16 '24 12:01 jaksle