# dgmm: Calculate the probability of a permutation in a GMM In PerMallows: Permutations and Mallows Distributions

## Description

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

## Usage

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

## Arguments

 `perm` permutation whose probability wants to be known `sigma0` central permuation of the GMM, by default the identity `theta` vector dispersion parameter of the GMM `dist.name` optional name of the distance used in the GMM. One of: kendall (default), cayley, hamming

## Value

The probability of sigma in the given GMM

## Examples

 ```1 2 3 4 5 6 7``` ```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) th <- c(0.1, 0.2, 0.3,1) log.prob <- apply(data,MARGIN=1,FUN=function(x){log(dgmm(x,sig, th, "hamming"))}) sum(log.prob) dgmm (c(1,2,3,4), theta=c(1,1,1)) dgmm (c(1,2,3,4), theta=c(1,1,1), dist.name="cayley") ```

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