-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multivariate KDE #2
Comments
Good piece of work. Would you mind if I ask if there is any progress on this? Thanks. |
Hi @humphreylee, I'm currently preoccupied with writing my dissertation, but I do intend to get back to this as soon as I am able. |
bump! |
Also a bump on this. We have an application, related to gene expression analysis, where we need a 2D density estimator. Currently, there are no crates for this in rust and we are calling out to a Python library which is both slow and much uglier than we'd like (the rest of the code is pure rust). It would be great to have the ability to do the density estimation in rust and this seems like the only crate I can find where this is even on the roadmap. |
Currently only univariate distributions are supported. A complete implementation would include seamless support for multivariate distributions. The only type that should be changed is the
KernelDensityEstimator
struct. Currently, the data structure is as follows:The
observations
field will need to be converted to analgebra::DMatrix
to support a multivariate distribution. The type should be hidden behind an alias so that end-users do not need to addnalgebra
as a dependency in their own projects.To prevent needless conversions for users working with univariate data, the data structure could instead add a generic parameter
T
representing the type ofobservations
. For univariate dataT
could be concretely represented asVec<Float>
and for multivariate dataT
could be concretely represented asMatrix2D
. However, this would require the introduction of two new traitsUnivariateKDE
andMultivariateKDE
to mimic overloading of the method namespdf
,cdf
, andsample
.Lastly, the traits
UnivariateKDE
andMultivariateKDE
should be sealed to prevent end-user implementations.The text was updated successfully, but these errors were encountered: