Skip to contents

Estimates each competitor's strength from counts of outcomes won inside groups, with an optional exposure offset. Used to build a phenotype that escapes the closure of a share: strengths are free parameters, while only the probabilities are normalized.

Usage

competition_strength(
  wins,
  group,
  competitor,
  exposure = NULL,
  prior = 0.5,
  tol = 1e-10,
  maxiter = 1000L
)

Arguments

wins

number of outcomes competitor competitor[k] won in group group[k]

group

the contest each row belongs to (a litter, a pen, a match). A missing group, NA, NaN, Inf, -Inf, blank text or the text "NaN", is refused with its row: those records would otherwise form one contest together

competitor

who competed; a missing competitor is refused the same way, since those records would otherwise be one competitor

exposure

opportunity of that competitor in that contest, a semen dose, a number of attempts. NULL means every competitor had the same. It enters as an offset, so the strength is ability PER UNIT of exposure

prior

a Gamma(prior, prior) shrinkage toward strength one, which keeps a competitor who never won on a finite scale; 0.5 by default, 0 for pure maximum likelihood (which diverges for a competitor with no wins)

tol

relative change in the log-strengths at which to stop

maxiter

maximum MM rounds

Value

list with strength (named, scaled to geometric mean one), log_strength, se (from the diagonal of the observed information, so it ignores the correlation between competitors and is optimistic when contests are few; NA outside the core of the win graph, where it does not exist), identifiable (named logical: is this competitor in the largest strongly connected component of the win graph), wins, contests, exposure_total, loglik, converged, iters, delta (the last change in the log-strengths), n_zero_wins and n_unidentifiable

Details

FORD'S CONDITION decides whether the number means anything. Ford (1957) showed that this likelihood has a finite and unique maximum only when the WIN GRAPH, an arrow from i to j whenever i won an outcome in a contest j also entered, is strongly connected. A competitor outside that core, someone who only ever lost or only ever won, sits on a likelihood that keeps improving in one direction: the Gamma prior is what keeps his estimate finite, and there is no curvature for a standard error to read. The result marks him in identifiable and gives him se = NA, and the call warns how many there are. In a real panel this is not a rare corner: on two independent cuts it reached 0.5% and 5% of the competitors. Filter on identifiable before ranking or before any variance decomposition.

References

Bradley, R.A. & Terry, M.E. (1952). Biometrika 39:324-345; Plackett, R.L. (1975). Applied Statistics 24:193-202; Luce, R.D. (1959). Individual Choice Behavior. Wiley.

Ford, L.R., Jr. (1957). American Mathematical Monthly 64:28-33.

Hunter, D.R. (2004). MM algorithms for generalized Bradley-Terry models. Annals of Statistics 32:384-406.