Package 'quickPWCR'

Title: Quickly construct and rate large binary pairwised comparisons
Description: A collection of functions for constructing large pairwised comparisons and rating them using Elo rating system with supporting parallel processing. The method of random sample pairs is based on Reservoir Sampling proposed by JVitter (1985) <doi:10.1145/3147.3165>.
Authors: Xiaohao Yang [aut, cre, cph]
Maintainer: Xiaohao Yang <[email protected]>
License: GPL-3
Version: 1.0
Built: 2025-01-24 04:10:34 UTC
Source: https://github.com/billbillbilly/quickpwcr

Help Index


randompair

Description

ramdonly pair players using reservoir sampling method.

Usage

m_elo(
  df_pw,
  wl,
  elo_randomisations = 500,
  initial_rating = 0,
  k = 100,
  cores = 1
)

Arguments

df_pw

dataframe, indicating a dataframe that includes the columns of winners and losers.

wl

vector, indicating the column names of winners and losers (c('w', 'l')). The first column name is for winners and the second column name is for losers.

elo_randomisations

numeric, indicating the number of interactions that the Elo rating system is run with the randomized pairwise comparisons

initial_rating

The initial rating of the players at the beginning

k

numeric, the K-factor determines the amount of change to the updated ratings

cores

numeric, indicating the number of CUP cores to be used for parallel processing

Value

dataframe

References

Glickman, M. E., & Jones, A. C. (1999). Rating the chess rating system. CHANCE-BERLIN THEN NEW YORK-, 12, 21-28.

Examples

df <- data.frame(a = c(1,6,0,4,'a','v',9,'n'), b = c('w',3,5,2,'d','j',8,'p'))
pw <- quickPWCR::m_elo(df_pw = df, 
                       wl = c('a', 'b'), 
                       elo_randomisations = 100, 
                       initial_rating = 1000, 
                       k = 100, 
                       cores = 1)

randompair

Description

ramdonly pair players using reservoir sampling method.

Usage

randompair(players, k, cores = 1)

Arguments

players

vector, indicating a list of players.

k

numeric, indicating how many players each player will be paired with.

cores

numeric, indicating the number of CUP cores to be used for parallel

Value

dataframe

References

JVitter, J. S. (1985). Random sampling with a reservoir. ACM Transactions on Mathematical Software (TOMS), 11(1), 37-57.

Examples

players <- c(1, 'a', 'c', 4, 7, 2, 'w', 'y', 3, 0, 8)
pw <- quickPWCR::randompair(players = players, k = 3)