dot-elo.seq_old: calculate Elo ratings

.elo.seq_oldR Documentation

calculate Elo ratings

Description

calculate Elo ratings from a sequence of dominance interactions

Usage

.elo.seq_old(
  winner,
  loser,
  Date,
  draw = NULL,
  presence = NULL,
  startvalue = 1000,
  k = 100,
  normprob = TRUE,
  init = "average",
  iterate = 0,
  runcheck = TRUE,
  progressbar = FALSE
)

Arguments

winner

either a factor or character vector with winner IDs of dyadic dominance interactions

loser

either a factor or character vector with loser IDs of dyadic dominance interactions

Date

character vector of form "YYYY-MM-DD" with the date of the respective interaction

draw

logical, which interactions ended undecided (i.e. drawn or tied)? By default all FALSE, i.e. no undecided interactions occurred. Note that in this case, winner/loser values can be interchanged

presence

optional data.frame, to supply data about presence and absence of individuals for part of the time the data collection covered. see details

startvalue

the value of Elo ratings of the two individuals that are involved in the first interaction of the overall sequence prior to this interaction. By default set to 1000. See also init

k

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

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

init

character, what Elo rating does an individual have prior to its first interaction. Three options are available: average: individuals always start with the value specified in startvalue. Given stable composition of the group, this also reflects the average Elo rating on each day in that group,
bottom: subjects entering at the current lowest Elo value if the lowest value getting lower its getting lower for all subjects which had this lowest values before, it is reflecting that in some species new subjects entering a group at the bottom level "bottom entry"
bottom_low: same as bottom but additionally the start values getting after the first interaction lower for all non-interacting subjects and, reflecting that we have at start no knowledge about the subjects this option offers for "bottom entry" species the possibility to consider that in a way that those subjects which are not interacting getting lower from start on

iterate

not yet implemented

runcheck

logical, should several checks regarding data integrety be performed, by default TRUE. See seqcheck

progressbar

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

Details

the presence 'matrix' is actually an object of class data.frame containing information about wether an individual was present on a given day or not. The first column represents the dates, running at least from the date of the earliest interaction until at least the date of the last interaction with one line per day (regardless of whether there were actually interactions observed on each day). Further, each individual is represented as a column in which "1" indicates an individual was present on the row-date and a "0" indicates the individuals absence on this date. NAs are not allowed. See advpres for an example.

Value

An object of class elo, which is list with 10 items that serves as basis to extract relevant information:

mat

a date by ID-matrix with raw Elo ratings

lmat

a date by ID-matrix with raw Elo ratings

cmat

a date by ID-matrix with raw Elo ratings

pmat

a date by ID-matrix with with presence data

nmat

a date by ID-matrix containing the number of interactions a given ID was involved in on a given day

logtable

details on each single interaction

stability

a data.frame containing information about stability (see stab_elo)

truedates

vector of class Date covering the ranges of dates in the dataset

misc

various

allids

a (sorted) character vector with all IDs that occur in the dataset

Author(s)

Christof Neumann and Lars Kulik

References

\insertRef

elo1978EloRating

\insertRef

albers2001EloRating

\insertRef

neumann2011EloRating

Examples

data(adv)
SEQ <- EloRating:::.elo.seq_old(winner=adv$winner, loser=adv$loser, Date=adv$Date)
summary(SEQ)


gobbios/EloRating documentation built on July 19, 2024, 4:05 a.m.