Indicator matrix from two sparse matrices for Bradley-Terry models
Source:R/weights_from_vector.R
bradleyterry_from_sparse.Rd
Provides a helper function for generating indicator matrices
Arguments
- winners
sparse matrix containing the winner for each observation
- losers
sparse matrix containing the loser for each observation
Examples
winners <- Matrix::fac2sparse(c("k", "k", "l", "m", "m"))
losers <- Matrix::fac2sparse(c("l", "m", "m", "k", "l"))
Wwl <- bradleyterry_from_sparse(winners, losers)