sdols (version 1.3)

expectedPairwiseAllocationMatrix: Compute Expected Pairwise Allocation Matrix

Description

This function computes the n-by-n matrix whose (i,j) element gives the estimated expected number of times that i and j are in the same subset (i.e, cluster or feature). For clusterings, this is the estimated probability that items are clustered together. For feature allocations, this is the estimated expectation of the number of shared features. These estimates are based on the frequencies from the supplied, randomly-sampled clusterings or feature allocations.

Usage

expectedPairwiseAllocationMatrix(x)

Arguments

x

A collection of clusterings or feature allocations. If x is a B-by-n matrix, each of the B rows represents a clustering of n items using cluster labels. For clustering b, items i and j are in the same cluster if x[b,i] == x[b,j]. If x is a list of length B, each element of list represents a feature allocation using a binary matrix of n rows and an arbitrary number of columns. For feature allocation b, items i and j share m features if, for k = 1, 2, ..., the expression x[[b]][i,k] == x[[b]][j,k] == 1 is true exactly m times.

Value

A n-by-n symmetric matrix whose (i,j) elements gives the estimated expected number of times that items i and j are in the same subset (i.e, cluster or feature) based on the frequencies from the supplied clusterings or feature allocations.

See Also

dlso, salso

Examples

Run this code
# NOT RUN {
probabilities <- expectedPairwiseAllocationMatrix(iris.clusterings)
probabilities

expectedCounts <- expectedPairwiseAllocationMatrix(USArrests.featureAllocations)
expectedCounts
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab