clusterSPcenters function

Compute centroids/medoids for clustered snow profiles

Compute centroids/medoids for clustered snow profiles

Wrapper for calculating centroids averageSP or medoids medoidSP when clustering, with efficient optimization when iterating kdba clustering calculations

clusterSPcenters( SPx, clustering, config, centers = "centroids", clustering_old = NULL, cents = NULL, distmat = NULL )

Arguments

  • SPx: a sarp.snowprofile::snowprofileSet to be clustered
  • clustering: vector of integers (from 1:k) indicating the cluster to which each snow profile is allocated
  • config: a list providing the necessary hyperparameters for distance and average calculations. Use clusterSPconfig functions for convenience!
  • centers: type of center to determine, either centroids (default) where an average profile is computed for each cluster or medoids where the index of the medoid profile is identified
  • clustering_old: same as clustering but from the previous iteration of a kdba (if provided then this function only computes new centroids when the profiles within a cluster changed)
  • cents: a sarp.snowprofile::snowprofileSet of centroids from the previous iteration; provide NULL if not available
  • distmat: a precomputed distance matrix of class dist (for faster medoid calculations)

Returns

a named sarp.snowprofile::snowprofileSet of centroid/medoids profiles for each cluster where the name refers to the corresponding cluster and is sorted in ascending manner.

See Also

clusterSPkdba , dbaSP

Author(s)

fherla shorton