ExchangeMem: Exchange the cluster assignment in the cluster partition...

View source: R/ExchangeMem.R

ExchangeMemR Documentation

Exchange the cluster assignment in the cluster partition vector. In the context of the CSSCA method, the function is esecially useful to add some randomness into the output of preliminary clustering analysis (e.g. Mcluster, iCluster and the non-sparse version of the CSSCA method)

Description

Exchange the cluster assignment in the cluster partition vector. In the context of the CSSCA method, the function is esecially useful to add some randomness into the output of preliminary clustering analysis (e.g. Mcluster, iCluster and the non-sparse version of the CSSCA method)

Usage

ExchangeMem(cluster_assign, ncluster, number)

Arguments

cluster_assign

the original vector of cluster assignment. The input vector should have N elements, and the nth element reresents the assigned cluster of the nth entry

ncluster

A non-negative integer represents the amount of clusters

number

A non-negative integer indicates the change of cluster memberships should apply to how many entries

Value

the new cluster assignment as indicatd by a new cluster partition vector with the length of N (the number of observations)

Examples

   #assume 6 entries and 3 clusters. The membrships of 3 entries should be changed
   cluser_ass <- c(1,1,2,2,3,3)
   n_cluster <- 3
   exe_number <- 3
 (not run) exchangemem(cluster_ass, n_cluster, exe_number)


syuanuvt/CSSCA documentation built on Nov. 28, 2022, 7:58 p.m.