asardaes / dtwclust

R Package for Time Series Clustering Along with Optimizations for DTW
https://cran.r-project.org/package=dtwclust
GNU General Public License v3.0
252 stars 29 forks source link

How to properly declare distance from TSclust with option #39

Closed wirginiad closed 5 years ago

wirginiad commented 5 years ago

I would be grateful to make sure if I properly deal with option for diss.CORT form TSclust. I want the deltahmethod to be set to DTW.

There's no error nor warning, but I wonder whether there is some other way to do it? The code is as follows:

mydist <- function(x, y){
       diss.CORT(x, y, k = 2, deltamethod="DTW")
  }

proxy::pr_DB$set_entry(FUN = mydist, names = c("CORT++dtw"),
                       loop = TRUE, type = "metric", distance = TRUE,
                       description = "CORT with DTW")

tsclust(data, type="hierarchical", k = 2,
        distance = "CORT++dtw",
        control=hierarchical_control(method="ward.D"))

I am deeply grateful for dtwclust package and your kind assitance.

asardaes commented 5 years ago

That looks correct to me. I don't know the specifics about that distance, but usage seems OK. I can't remember right now if more warnings are thrown if you set trace=TRUE, but if that's the case, I think it only warns about series with different lengths, which you could ignore if the distance you're using supports that.

wirginiad commented 5 years ago

Thank you very much.