View source: R/tclustWithInitialization.R
tclustWithInitialization | R Documentation |
A wrapper for the function tclust_H.
tclustWithInitialization(
initialization,
cytometry,
i.sol.type = "points",
trimming = 0.05,
restr.fact = 1000
)
initialization |
Initial solution for parameters provided by the user. Can be a matrix of data containing observations anc cluster assignations or can be a list spesifying a multivariate mixture of gaussians. |
cytometry |
A matrix or data.frame of dimension n x p, containing the observations (row-wise). |
i.sol.type |
Type of initial solutions in c('points', 'barycenters'). 'points' refers to a classified data matrix, while 'barycenters' to a multivariate mixture. |
trimming |
The proportion of observations to be trimmed. |
restr.fact |
The constant restr.fact >= 1 constrains the allowed differences among group scatters. Larger values imply larger differences of group scatters, a value of 1 specifies the strongest restriction. |
A list with entries:
A numerical vector of size n containing the cluster assignment for each observation. Cluster names are integer numbers from 1 to k, 0 indicates trimmed observations.
Number of clusters actually found.
he value of the objective function of the best (returned) solution.
x <- rbind(matrix(rnorm(100), ncol = 2), matrix(rnorm(100) + 2, ncol = 2),
matrix(rnorm(100) + 4, ncol = 2))
## robust cluster obtention from a sample x asking for 3 clusters,
## trimming level 0.05 and constrain level 12
k <- 3; alpha <- 0.05; restr.fact <- 12
output = tclust_H(x = x, k = k, alpha = alpha, nstart = 50, iter.max = 20,
restr = 'eigen', restr.fact = restr.fact, sol_ini_p = FALSE, sol_ini = NA,
equal.weights = FALSE, trace = 0, zero.tol = 1e-16)
## cluster assigment
output2 <- tclustWithInitialization(data.frame(x, output$cluster), x, 'points', 0.05, 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.