Specify time series clustering via dtwclust
The name of the response variable.
The name of the time variable.
The name of the trajectory identifier variable.
Number of clusters.
Arguments passed to dtwclust::tsclust. The following arguments are ignored: series, k, trace.
sardaespinosa2019timelatrend
Other lcMethod implementations:
getArgumentDefaults()
,
getArgumentExclusions()
,
lcMethod-class
,
lcMethodAkmedoids
,
lcMethodCrimCV
,
lcMethodFeature
,
lcMethodFunFEM
,
lcMethodFunction
,
lcMethodGCKM
,
lcMethodKML
,
lcMethodLMKM
,
lcMethodLcmmGBTM
,
lcMethodLcmmGMM
,
lcMethodMclustLLPA
,
lcMethodMixAK_GLMM
,
lcMethodMixtoolsGMM
,
lcMethodMixtoolsNPRM
,
lcMethodRandom
,
lcMethodStratify
data(latrendData)
if (require("dtwclust")) {
method <- lcMethodDtwclust("Y", id = "Id", time = "Time", nClusters = 3)
model <- latrend(method, latrendData)
}
#> Loading required package: dtwclust
#> Loading required package: proxy
#>
#> Attaching package: ‘proxy’
#> The following objects are masked from ‘package:stats’:
#>
#> as.dist, dist
#> The following object is masked from ‘package:base’:
#>
#> as.matrix
#> Loading required package: dtw
#> Loaded dtw v1.23-1. See ?dtw for help, citation("dtw") for use in publication.
#> dtwclust:
#> Setting random number generator to L'Ecuyer-CMRG (see RNGkind()).
#> To read the included vignettes type: browseVignettes("dtwclust").
#> See news(package = "dtwclust") after package updates.
#>
#> Precomputing distance matrix...
#>
#> Iteration 1: Changes / Distsum = 200 / 399.6059
#> Iteration 2: Changes / Distsum = 10 / 348.9926
#> Iteration 3: Changes / Distsum = 0 / 348.9926
#>
#> Elapsed time is 5.946 seconds.
#>