randomelo: calculate Elo ratings from an interaction matrix

Description Usage Arguments Value Author(s) Examples

View source: R/randomelo.R

Description

calculate Elo ratings from an interaction matrix based on randomly generated sequences

Usage

1
2
3
4
5
6
7
randomelo(
  interactionmatrix,
  runs = 2000,
  normprob = TRUE,
  k = 100,
  progressbar = FALSE
)

Arguments

interactionmatrix

square interaction matrix with winner in rows and losers in columns, for example the output from creatematrix

runs

number of randomly generated sequences based on the interactions in the interactionmatrix

normprob

logical (by default TRUE). Should a normal curve be assumed for calculating the winning/losing probablities, or a logistic curve. See winprob for details

k

numeric, factor k that determines the maximum change in ratings. By default k=100

progressbar

logical, should progress bars be displayed, by default progressbar=TRUE

Value

list of length 2. The first element contains a matrix with the final rating of each individual from each random sequence. IDs are in the columns, each run is represented as one row. The second element of the list contains the original interaction matrix.

Author(s)

Christof Neumann

Examples

1
2
3
4
5
data(adv)
elores <- elo.seq(winner = adv$winner, loser = adv$loser, Date = adv$Date)
mat <- creatematrix(elores)
res <- randomelo(mat, 10)
data.frame(ID = colnames(res[[1]]), avg = round(colMeans(res[[1]]), 1))

Example output

Loading required package: zoo

Attaching package:zooThe following objects are masked frompackage:base:

    as.Date, as.Date.numeric

Loading required package: sna
Loading required package: statnet.common

Attaching package:statnet.commonThe following object is masked frompackage:base:

    order

Loading required package: network
network: Classes for Relational Data
Version 1.16.1 created on 2020-10-06.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
                    Mark S. Handcock, University of California -- Los Angeles
                    David R. Hunter, Penn State University
                    Martina Morris, University of Washington
                    Skye Bender-deMoll, University of Washington
 For citation information, type citation("network").
 Type help("network-package") to get started.

sna: Tools for Social Network Analysis
Version 2.6 created on 2020-10-5.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
 For citation information, type citation("sna").
 Type help(package="sna") to get started.

  ID    avg
a  a  814.0
b  b 1072.7
c  c 1140.0
d  d 1087.6
e  e  900.6
f  f  946.4
g  g  992.9

EloRating documentation built on March 26, 2020, 7:29 p.m.