SFclust {FKmL}R Documentation

Sparse Fréchet Distance-Based K-medoids for Longitudinal Data

Description

Performs clustering on longitudinal trajectories using a sparse feature weighting scheme and Fréchet distance. The method iteratively updates cluster assignments and feature weights subject to an \ell_1 norm constraint.

Usage

SFclust(k, l1bound, dist.ary, maxIter = 20, eps = 1e-04)

Arguments

k

The number of clusters.

l1bound

A bound on the \ell_1 norm for the weight updates. It must lie between 1 and the square root of the number of variables.

dist.ary

A 3-dimensional array of pairwise Fréchet distances. The array should be of shape (n, n, p), where n is the number of trajectories and p is the number of variables. Each dist.ary[,,j] stores the pairwise distances for the j-th variable.

maxIter

The maximum number of iterations before stopping if convergence is not reached. Default is 20.

eps

A small positive threshold for convergence. The algorithm stops when the change in weights becomes smaller than this threshold. Default is 1e-4.

Details

The function assumes that the input dist.array contains pairwise distances between trajectories for each variable, using the generalized Fréchet distance. Clustering is performed via a k-medoids algorithm, and feature weights are updated using between-cluster sum of squares (BCSS) with sparsity control. If the number of variables is one, only clustering is performed, and no variable weighting is applied. This function involves random sampling internally. For reproducible results, set the random seed before calling the function using set.seed().

Value

A list containing the following components:

clust

A vector of cluster assignments for each trajectory.

final.weight

The final weight vector after the last iteration, reflecting the contribution of each variable to the clustering process.

weight.history

A matrix of weight values at each iteration, showing how the feature weights evolved.

criteria

A vector of convergence criteria values for each iteration, quantifying the change in weights.

iteration

The number of iterations performed before convergence or reaching maxIter.


[Package FKmL version 0.1.1 Index]