View source: R/weights_from_vector.R
bradleyterry_from_sparse | R Documentation |
Provides a helper function for generating indicator matrices
bradleyterry_from_sparse(winners, losers)
winners |
sparse matrix containing the winner for each observation |
losers |
sparse matrix containing the loser for each observation |
sparse Bradley-Terry indicator matrix of type Matrix::dgCMatrix
winners <- Matrix::fac2sparse(c("k", "k", "l", "m", "m"))
losers <- Matrix::fac2sparse(c("l", "m", "m", "k", "l"))
Wwl <- bradleyterry_from_sparse(winners, losers)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.