This function estimates the exact MLE of a Mallows-Binomial distribution using an A* tree search algorithm proposed in Pearce and Erosheva (2022). Algorithm may be very slow when number of objects exceeds 15, but is often still tractable for larger J when consensus is strong.

ASTAR(rankings, ratings, M, keep_nodes = FALSE)

Arguments

rankings

A matrix of rankings, potentially with attribute "assignments" to signify separate reviewer assignments. One ranking per row.

ratings

A matrix of ratings, one row per judge and one column per object.

M

Numeric specifying maximum (=worst quality) integer rating.

keep_nodes

Boolean specifying if function should retain the list of open nodes traversed during A* tree search. Defaults to FALSE.

Value

A list with elements pi0, the estimated consensus ranking MLE, p, the estimated object quality parameter MLE, theta, the estimated scale parameter MLE, and numnodes, number of nodes traversed during algorithm and a measure of computational complexity. If keep_nodes == TRUE, then the list also contains nodes, a matrix of open nodes remaining at the end of search. If multiple MLEs are found, pi0, p, and theta are returned a matrix elements, with one row per MLE.

Examples

data("ToyData1")
ASTAR(ToyData1$rankings,ToyData1$ratings,ToyData1$M,keep_nodes=TRUE)
#> $pi0
#> [1] 1 2 3
#> 
#> $p
#> [1] 0.125 0.125 0.750
#> 
#> $theta
#> [1] 1e+08
#> 
#> $num_nodes
#> [1] 5
#> 
#> $nodes
#>      [,1] [,2]   [,3]
#> [1,]    2   NA 6.9158
#> [2,]    3   NA 9.4300
#> [3,]    1    3 8.6419
#>