Description Usage Arguments Details Value Author(s) Examples
Creates a matrix to collapse the rows of a tournamewnt prediction matrix
1 | collapse_prediction(ranks = c(1, 2, 3, 4, 8, 16, 32))
|
ranks |
An integer vector of R ordered elements giving the cut offs of the ranks to create |
Returns a vector of numeric values. Elements in the input factor that cannot be converted to numeric will produce NA.
Returns a numeric matrix with R rows and T columns that can be multiplied on a square prediction matrix to obtain the collapsed predictions
Claus Ekstrom ekstrom@sund.ku.dk
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.