Processing math: 100%

An alignment based on product weights sets the weight between topics k and k' according to γTkγk, where γkRn+ provides the mixed membership assigned to topic k across the n samples (and similarly for topic k). This function computes these weights given a list of two n×K gamma matrices.

product_weights(gammas, ...)

Arguments

gammas

(required) A list of length two, containing the mixed membership matrices (a matrix of dimension n-samples by k-topics) to compare. The number of columns may be different, but the number of samples must be equal.

...

(optional) Other keyword arguments. These are unused by the product_weights alignment strategy, but is included for consistency across weight functions.

Value

products A data.frame giving the product similarity of each pair of topics across the two input matrices.

See also

align_graph

Examples

g1 <- matrix(runif(20 * 2), 20, 2)
g2 <- matrix(runif(20 * 4), 20, 4)
product_weights(list(g1, g2))
#> # A tibble: 8 × 3
#>   k     k_next weight
#>   <chr> <chr>   <dbl>
#> 1 1     1        4.52
#> 2 1     2        4.21
#> 3 1     3        4.43
#> 4 1     4        4.89
#> 5 2     1        6.47
#> 6 2     2        4.97
#> 7 2     3        6.73
#> 8 2     4        6.55