philips-software / latrend

An R package for clustering longitudinal datasets in a standardized way, providing interfaces to various R packages for longitudinal clustering, and facilitating the rapid implementation and evaluation of new methods
https://philips-software.github.io/latrend/
GNU General Public License v2.0
28 stars 5 forks source link

Mahalanobis distance metric #14

Open niekdt opened 3 years ago

niekdt commented 3 years ago

Implement the Mahalanobis Distance (MD) as an internal metric. As MD is a distance measure, it could be used in different ways: measuring the distance of the trajectories to their most likely cluster trajectory, or measuring the distances between cluster trajectories.

Variations:

SeoYeonJu4382 commented 7 months ago

Thank you for great develop for distance matrix change. But i have some question,

my code

options(latrend.id = "Id", latrend.time = "Time") for(d_n in c("Mahalanobis")){ kmlMethod_i <- lcMethodKML(response = "Y", nClusters = 3, distanceName = d_n) model_i <- latrend(kmlMethod_i, data = latrendData) summary(model_i) print(plot(model_i)) }

as you mention that i try toy experiments but i got "Error in distance(x, clustersCenter[1, ]) : unused arguments (x, clustersCenter[1, ]): " message can i ask what is worng with my code?

and also i want to use correlation distance too. but it cannot be possible now. is there any comments and possible way?

i really want to know your answer or feedback. I look forward to hearing from you.

niekdt commented 6 months ago

Thanks for reporting this, I'll look into it.

It's not yet possible to compute the correlation distance. Is there a package that has a function for that, that I could add?