Description Usage Arguments Details Value See Also Examples
View source: R/nearest_point.R
This is equivalent to performing the initial "E" step in expectation maximisation (EM) for a multinomial mixture model.
1 | multinomial_mix(target, profiles)
|
target |
A vector of citations to be compared |
profiles |
A matrix of |
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.
A vector of log-probabilities that each community generated target
's citation profile.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.