kmeans_hurst: K-means clustering

View source: R/Kmeans_clustering.R

kmeans_hurstR Documentation

K-means clustering

Description

This function performs k-means clustering of realisations based on the estimated Hurst functions.

Usage

kmeans_hurst(X.t, k, ..., N = 100, Q = 2, L = 2)

Arguments

X.t

A list of data frames. In each data frame, the first column is a numeric time sequence and the second gives the values of the processes or time series. To get reliable results, it is recommended to use at least 500 time points. See Examples for usage.

k

The desired number of clusters.

...

Optional arguments: iter.max, nstart and algorithm. Refer kmeans.

N

Argument used for the estimation of Hurst functions. Number of sub-intervals on which the estimation is performed on. Default is set to 100 sub-intervals.

Q

Argument used for the estimation of Hurst functions. Fixed integer greater than or equal to 2. Default is set to 2.

L

Argument used for the estimation of Hurst functions. Fixed integer greater than or equal to 2. Default is set to 2.

Details

The Hurst function of each realisation is estimated using Hurst. The smoothed Hurst estimates are used for k-means clustering in kmeans. The Hartigan and Wong algorithm is used as the default k-means clustering algorithm.

Value

An object list of class "k_hurst" with print and plot methods. The list has following components:

cluster_info

A data frame indicating the cluster number and euclidean distance to cluster center of each smoothed estimated Hurst function (item)

cluster

A vector of cluster number of each item.

cluster_sizes

Number of item in each cluster.

centers

A data frame of cluster centers. Center obtained as the average of each smoothed estimated Hurst function in the cluster. Columns denote time points in which estimates were obtained. Row names denote cluster numbers.

smoothed_Hurst_estimates

A data frame of smoothed Hurst estimates. Columns denote time points in which estimates were obtained. Rows denote estimates for each realisation.

raw_Hurst_estimates

A list of data frames of raw Hurst estimates.

call

Information about the input parameters used.

See Also

print.k_hurst, plot.k_hurst, hclust_hurst

Examples


#Simulation of multifractional processes
t <- seq(0, 1, by = (1/2)^10)
H1 <- function(t) {return(0.1 + 0*t)}
H2 <- function(t) {return(0.2 + 0.45*t)}
H3 <- function(t) {return(0.5 - 0.4 * sin(6 * 3.14 * t))}
X.list.1 <- replicate(3, GHBMP(t, H1),simplify = FALSE)
X.list.2 <- replicate(3, GHBMP(t, H2),simplify = FALSE)
X.list.3 <- replicate(3, GHBMP(t, H3),simplify = FALSE)
X.list <- c(X.list.1, X.list.2, X.list.3)

#K-means clustering based on k = 3 clusters
KC <- kmeans_hurst(X.list, k = 3)
print(KC)

#Plot of smoothed Hurst functions in each cluster with cluster centers
plot(KC, type = "ec")


Rmfrac documentation built on Sept. 10, 2025, 10:31 a.m.