cg_topics: Compute the center of gravity of the clusters

Description Usage Arguments Value Examples

View source: R/cg_topics.R

Description

This function computes the center of gravity for each cluster by taking weighted mean of each component of features where the weights are determined from the theta matrix of the topic model fit.

Usage

1
cg_topics(theta, feature.comp)

Arguments

theta

The cluster probability distribution/theta matrix obtained from the GoM model fitting (it is a G x K matrix where G is number of features, K number of topics)

feature.comp

the numeric matrix (G x L) comprising of values for each feature g and feature metadata l.

Value

Returns a matrix of cluster centers of gravity for the L feature metadata.

Examples

1
2
3
4
5
6
7
N=360;
M=560;
lat <- rep(1:N, M);
long <- rep(1:M, each=N)
comp <- cbind(lat, long);
data(AbundanceGoM)
center_gravity <- cg_topics(AbundanceGoM$theta, comp);

kkdey/CountClust documentation built on Feb. 14, 2018, 4:26 p.m.