dmm {PerMallows} | R Documentation |
Calculate the probability of a permutation sigma in a MM of center sigma0, dispersion parameter theta and under the specified distance
dmm(perm, sigma0 = identity.permutation(length(perm)), theta, dist.name = "kendall")
perm |
permutation whose probability is asked for |
sigma0 |
optional central permuation of the MM, by default the identity |
theta |
dispersion parameter of the MM |
dist.name |
optional name of the distance used in the MM. One of: kendall (default), cayley, hamming, ulam |
The probability of sigma in the given MM
data <- matrix(c(1,2,3, 4,1,4,3,2,1,2,4,3), nrow = 3, ncol = 4, byrow = TRUE) sig<-c(1,2,3,4) log.prob <- apply(data,MARGIN=1,FUN=function(x){log(dmm(x,sig, 1,"cayley"))}) sum(log.prob) dmm(c(1,3,2,4), theta=0.1) dmm(c(1,3,2,4), theta=0.1, dist.name="cayley") dmm(c(1,3,2,4), theta=0.1, dist.name="hamming") dmm(c(1,3,2,4), theta=0.1, dist.name="ulam")