collapse_prediction: Create a matrix to collapse tournament predictions to ranks

Description Usage Arguments Details Value Author(s) Examples

Description

Creates a matrix to collapse the rows of a tournamewnt prediction matrix

Usage

1
collapse_prediction(ranks = c(1, 2, 3, 4, 8, 16, 32))

Arguments

ranks

An integer vector of R ordered elements giving the cut offs of the ranks to create

Details

Returns a vector of numeric values. Elements in the input factor that cannot be converted to numeric will produce NA.

Value

Returns a numeric matrix with R rows and T columns that can be multiplied on a square prediction matrix to obtain the collapsed predictions

Author(s)

Claus Ekstrom ekstrom@sund.ku.dk

Examples

1
2
3
4
5
6
m2 <- matrix(c(.5, .5, 0, 0, .5, .5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), 4)
# Collapse into ranks 1, 2, and 3+4
collapse <- collapse_prediction(c(1, 2, 4))

collapsed_prediction <- collapse %*% m2
collapsed_prediction

socceR documentation built on July 3, 2019, 5:05 p.m.