# dmm: Calculate the probability of a permutation in a MM In PerMallows: Permutations and Mallows Distributions

## Description

Calculate the probability of a permutation sigma in a MM of center sigma0, dispersion parameter theta and under the specified distance

## Usage

 ```1 2``` ```dmm(perm, sigma0 = identity.permutation(length(perm)), theta, dist.name = "kendall") ```

## Arguments

 `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

## Value

The probability of sigma in the given MM

## Examples

 ```1 2 3 4 5 6 7 8``` ```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") ```

PerMallows documentation built on May 2, 2019, 6:14 a.m.