clusterSPcenters: Compute centroids/medoids for clustered snow profiles

View source: R/clusterSPcenters.R

clusterSPcentersR Documentation

Compute centroids/medoids for clustered snow profiles

Description

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

Usage

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)

Value

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.

Author(s)

fherla shorton

See Also

clusterSPkdba, dbaSP


sarp.snowprofile.alignment documentation built on Sept. 11, 2024, 9:23 p.m.