This function randomly generates rankings and ratings from a Mallows-Binomial distribution.

rmb(I, p, theta, M, pi0 = NULL, R = NULL)

Arguments

I

A numeric entry indicating the number of observations to be drawn, i.e., the number of judges providing rankings and ratings.

p

A vector specifying the underlying object qualities. All values between be between 0 and 1, inclusive.

theta

A numeric entry specifying the Mallows scale parameter.

M

A numeric entry specifying the maximum integer rating.

pi0

A vector specifying the consensus (modal probability) ranking; should be used only for tie-breaking equal values in p.

R

A numeric entry specifying the length of the rankings to be drawn. When R<=length(p), partial rankings are drawn by definition.

Value

A list containing elements ratings, a matrix of integer ratings with one row per judge and one column per object, rankings, and matrix of rankings (orderings) with one row per judge, and M, the inputted maximum integer rating.

Examples

rmb(I=5,p=c(.1,.3,.4,.7,.9),theta=1,M=10)
#> $ratings
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    1    5    4    8    8
#> [2,]    1    2    4   10    9
#> [3,]    2    4    3    6   10
#> [4,]    1    3    4    6    8
#> [5,]    1    1    3    7    9
#> 
#> $rankings
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    1    3    2    4    5
#> [2,]    2    1    3    4    5
#> [3,]    2    1    4    3    5
#> [4,]    3    1    2    4    5
#> [5,]    1    3    2    4    5
#> 
#> $M
#> [1] 10
#> 
rmb(I=10,p=c(.1,.3,.3,.7,.9),pi0=c(1,3,2,4,5),theta=5,M=40,R=3)
#> $ratings
#>       [,1] [,2] [,3] [,4] [,5]
#>  [1,]    1   11   12   27   35
#>  [2,]    3    8    8   26   38
#>  [3,]    3   16   14   27   37
#>  [4,]    8    9   13   22   38
#>  [5,]    2    8   12   28   34
#>  [6,]    1   15   12   31   37
#>  [7,]    5   15   14   29   38
#>  [8,]    6   15   11   33   33
#>  [9,]    5   10   11   31   37
#> [10,]    3   16   10   31   36
#> 
#> $rankings
#>       [,1] [,2] [,3] [,4] [,5]
#>  [1,]    1    3    2   NA   NA
#>  [2,]    1    3    2   NA   NA
#>  [3,]    1    3    2   NA   NA
#>  [4,]    1    3    2   NA   NA
#>  [5,]    1    3    2   NA   NA
#>  [6,]    1    3    2   NA   NA
#>  [7,]    1    3    2   NA   NA
#>  [8,]    1    3    2   NA   NA
#>  [9,]    1    3    2   NA   NA
#> [10,]    1    3    2   NA   NA
#> 
#> $M
#> [1] 40
#>