Type: Package
Title: Functional Iterative Hierarchical Clustering
Version: 0.1.0
Description: Functional clustering aims to group curves exhibiting similar temporal behaviour and to obtain representative curves summarising the typical dynamics within each cluster. A key challenge in this setting is class imbalance, where some clusters contain substantially more curves than others, which can adversely affect clustering performance. While class imbalance has been extensively studied in supervised classification, it has received comparatively little attention in unsupervised clustering. This package implements functional iterative hierarchical clustering ('funIHC'), an adaptation of the iterative hierarchical clustering method originally developed for multivariate data, to the functional data setting. For further details, please see Higgins and Carey (2024) <doi:10.1007/s11634-024-00611-8>.
License: MIT + file LICENSE
Encoding: UTF-8
Depends: R (≥ 4.0.0)
Imports: fda, stats, cluster, mclust
Suggests: testthat (≥ 3.0.0), knitr, rmarkdown, covr
RoxygenNote: 7.3.3
Config/testthat/edition: 3
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2026-01-08 12:41:14 UTC; crtuser
Author: Catherine Higgins [aut, cre], Michelle Carey [aut]
Maintainer: Catherine Higgins <catherine.higgins@ucd.ie>
Repository: CRAN
Date/Publication: 2026-01-09 19:40:02 UTC

Functional Iterative Hierarchical Clustering

Description

Performs Functional Iterative Hierarchical Clustering (funIHC) as described in 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

Usage

funIHC(x, Data, type = 0)

Arguments

x

Numeric vector of time points.

Data

Numeric matrix with rows corresponding to time points and columns to individual curves.

type

Integer specifying representation: 0 = curves (default), 1 = first derivative, 2 = basis coefficients.

Value

A list containing:

label

Integer vector of cluster labels.

clusters

Clustered observations.

fd

Functional data object.

mean_clusters_mat

Cluster means.

Examples


## Load example data within the package
rds_path <- system.file("extdata", "U1505.rds", package = "funIHC")
example_data <- readRDS(rds_path)

## Extract curves
Data <- example_data$Data
Data <- t(Data)
x = 1:15 #number of time points

## Run functional iterative hierarchical clustering
res <- funIHC(x,Data)

## Inspect cluster assignments
table(res$label)