multinomial_mix: Multinomial mixture probabilities

Description Usage Arguments Details Value See Also Examples

View source: R/nearest_point.R

Description

This is equivalent to performing the initial "E" step in expectation maximisation (EM) for a multinomial mixture model.

Usage

1
multinomial_mix(target, profiles)

Arguments

target

A vector of citations to be compared

profiles

A matrix of community_profile()s

Details

Here we are effectively computing the nearest point in the convex hull of community profiles, implicitly using Kullback–Leibler divergence as the distance measure. Alternative distance measures may be used; see nearest_point() and others.

Value

A vector of log-probabilities that each community generated target's citation profile.

See Also

nearest_point()

Examples

1
2
3
4
5
6
7
8
# To which cluster should 'Biometrika' belong?
distances <- as.dist(1 - cor(citations + t(citations)))
clusters <- cutree(hclust(distances), h = 0.8)
profiles <- community_profile(citations, clusters)
Biometrika <- citations[, 'Bka']
w <- multinomial_mix(Biometrika, profiles)
which.max(w) == clusters['Bka']
profiles %*% exp(w) # nearest point

Selbosh/scrooge documentation built on May 5, 2019, 8 p.m.