View source: R/idld_cluster_boot.R
| idld_cluster_boot | R Documentation |
It is partition-based clustering technique based on local depth and distance measurement applied to data. This functional selects the optimal alpha_quantile for the procedure.
idld_cluster_boot(Z, beta, m, K, B, type, verbose = FALSE)
Z |
data to apply depth. It should be an array of dimension (n,p,l) where l is the number of functional coordinates. Z[,,i] is a numeric matrix where each row represents a functional observation for i=1,...,l. |
beta |
locality parameter between 0 and 1 |
m |
number of random projections |
K |
number of clusters |
B |
number of bootstrap samples |
type |
the data type to apply the idld, "multivariate", "functional" or "multi_functional". |
verbose |
if TRUE prints the algorithm progress. |
returns a list with the following components:
local_depth a numeric vector object that contains the depth for each point.
region vector of booleans indicating which data points is in the central region.
clusters numeric vector with the partition.
library(funHDDC)
library(abind)
data("triangle")
triangle_data = abind(triangle[,1:101], triangle[,102:202], along=3)
d = dim(triangle_data)
triang_cl = idld_cluster_boot(triangle_data, 0.2, 100, 3, 20, "multi_functional", TRUE)
par(mfrow=c(1,2))
plot(triangle_data[1,,1], type="n", ylim=c(0,8))
for (i in 1:d[1]) lines(triangle_data[i,,1], col=triang_cl$clusters[i])
plot(triangle_data[1,,2], type="n", ylim=c(0,8))
for (i in 1:d[1]) lines(triangle_data[i,,2], col=triang_cl$clusters[i])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.