Skip to contents

Provides a helper function for generating indicator matrices

Usage

bradleyterry_from_sparse(winners, losers)

Arguments

winners

sparse matrix containing the winner for each observation

losers

sparse matrix containing the loser for each observation

Value

sparse Bradley-Terry indicator matrix of type Matrix::dgCMatrix

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)