clusternomics index

Estimate sizes of clusters from global cluster assignments.

1 | ```
clusterSizes(assignments)
``` |

`assignments` |
Matrix of cluster assignments, where each row corresponds to cluster assignments sampled in one MCMC iteration |

Sizes of individual clusters in each MCMC iteration.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
# Generate simple test dataset
groupCounts <- c(50, 10, 40, 60)
means <- c(-1.5,1.5)
testData <- generateTestData_2D(groupCounts, means)
datasets <- testData$data
# Fit the model
# 1. specify number of clusters
clusterCounts <- list(global=10, context=c(3,3))
# 2. Run inference
# Number of iterations is just for demonstration purposes, use
# a larger number of iterations in practice!
results <- contextCluster(datasets, clusterCounts,
maxIter = 10, burnin = 5, lag = 1,
dataDistributions = 'diagNormal',
verbose = TRUE)
# Extract only the sampled global assignments
samples <- results$samples
clusters <- plyr::laply(1:length(samples), function(i) samples[[i]]$Global)
clusterSizes(clusters)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.