Learn R Programming

CountClust (version 1.0.2)

compare_omega: Re-ordering cluster membership proportion matrices and Information calculation

Description

This function computes a re-ordering of the clusters from GoM model fit in one model to make it comparable with that from another. The two models are applied on the same set of samples with same number of clusters, but the features may change from one model to another. The two models may not be of same type as well. One could be a DAPC model, the other a standard topic model. Aids in checking for consistency in topic proportion patterns across multiple GoM methods or across different types of feature sets.

Usage

compare_omega(omega1, omega2)

Arguments

omega1
cluster membership proportion matrix (N x K) from model 1
omega2
cluster membership proportion matrix (N x K) from model 2

Value

Returns a list containing
kl.dist
A symmetric KL divergence matrix across the re-ordered clusters of two omega matrices
kl.order_model2_topics
re-ordering of the clusters for omega2 to match the clusters for omega1 based on KL divergence
kl.information_content
A measure based on KL information to record how much information in omega2 is explained by omega1. Varies from 0 to 1
cor.dist
A correlation matrix across the re-ordered clusters of two omega matrices
cor.order_model2_topics
re-ordering of the clusters for omega2 to match the clusters for omega1 based on correlation information
cor.information_content
A measure based on correlation information to record how much information in omega2 is explained by omega1. Varies from 0 to 1

Examples

Run this code
tt=10;
omega1=matrix(rbind(gtools::rdirichlet(tt*10,c(3,4,2,6)),
                     gtools::rdirichlet(tt*10,c(1,4,6,3)),
                      gtools::rdirichlet(tt*10,c(4,1,2,2))), nrow=3*10*tt);
omega2=matrix(rbind(gtools::rdirichlet(tt*10,c(1,2,4,6)),
                       gtools::rdirichlet(tt*10,c(1,4,6,3)),
                      gtools::rdirichlet(tt*10,c(3,1,5,2))), nrow=3*10*tt);
out <- compare_omega(omega1, omega2)

Run the code above in your browser using DataLab