dmall.Rd
This function calculates the density of observation(s) under a Mallows distribution.
dmall(rankings, pi0, theta, log = FALSE)
A matrix of rankings, potentially with attribute "assignments" to signify separate reviewer assignments. One ranking per row.
A vector specifying the consensus (modal probability) ranking; should be used only for tie-breaking
equal values in p
.
A numeric entry specifying the Mallows scale parameter.
A boolean indicating if the log likelihood should be returned.
A numeric value indicating the (log) likelihood of rankings under a Mallows distribution.
rankings1 <- matrix(c(1,2,3,3,1,2),nrow=2,byrow=TRUE)
rankings2 <- matrix(c(1,2,3,4,2,3,NA,NA),nrow=2,byrow=TRUE)
attr(rankings2,"assignments") <- matrix(c(rep(TRUE,4),FALSE,TRUE,TRUE,TRUE),nrow=2,byrow=TRUE)
dmall(rankings=c(1,2,3,NA),pi0=c(1,2,3,4),theta=2)
#> [1] 0.6603815
dmall(rankings=rankings1,pi0=c(1,2,3),theta=2)
#> [1] 0.0106764
dmall(rankings=rankings2,pi0=c(1,2,3,4),theta=3,log=TRUE)
#> [1] -0.2501293