The funIHC package implements the functional iterative hierarchical clustering method from the paper Higgins, C., Carey, M. Addressing class imbalance in functional data clustering. Adv Data Anal Classif (2024). https://doi.org/10.1007/s11634-024-00611-8
As described in our paper, we propose three distinct distance metrics for use with funIHC:
funIHC (curves): where the functional form of the curves is directly utilized with a measure of functional distance to quantify dissimilarity between them. Set type=0
funIHC (1st derivative): the first-order derivative of the curves is utilized with a measure of functional distance to quantify dissimilarity between them. Set type=1
funIHC (coefficients): which involves a dimension reduction via a basis function expansion of the original curves followed by computation of distances based on the resulting vectors. Set type=2
An example demonstrating how to use funIHC, along with the data required to reproduce simulations described in our paper, is provided.
library(funIHC)
rds_path <- system.file("extdata", "U1505.rds", package = "funIHC")
example_data <- readRDS(rds_path) #Data from Table 2 in the paper, with M=15 and sigma = 0.05
Data <- example_data$Data
Data = t(Data)
x = 1:15 #Number of time points (M=15 or 200 in the simulations)
res = funIHC(x,Data,type=0) #Run funIHC, type refers to the choice of distance metric: curves (0), first derivative (1) or coefficients (2)
#> Standard error of fit = 0.067978
table(res$label)
#>
#> 1 2 3 4 5 6
#> 500 500 200 15 3 10