rmm: Sample a Mallows Model

Description Usage Arguments Value References Examples

View source: R/PerMallows.R

Description

Generate a sample of n permutations from a Mallows Model (MM).

Usage

1
2
rmm(n, sigma0, theta, dist.name = "kendall", sampling.method = NULL,
  disk = FALSE, alert = TRUE)

Arguments

n

the number of permutations to be generated

sigma0

central permuation of the MM

theta

dispersion parameter of the MM

dist.name

optional name of the distance used in the MM. One of: kendall (default), cayley, hamming, ulam

sampling.method

optional name of the sampling algorithm. One of: distances, multistage, gibbs (default)

disk

optional can only be true if using the Distances sampling algorithm for generating under the Ulam distance. Insted of generating the whole set of SYT and count of permutations per distance, it loads the info from a file in the disk

alert

check consistency of the parameters. TRUE by default

Value

A matrix contaning a sample of permutations from the specified ditribution

References

"Ekhine Irurozki, Borja Calvo, Jose A. Lozano (2016). PerMallows: An R Package for Mallows and Generalized Mallows Models. Journal of Statistical Software, 71(12), 1-30. doi:10.18637/jss.v071.i12"

Examples

1
2
3
4
5
6
rmm(2,c(1,2,3,4,5),1,"kendall", "distances")
rmm(2,c(1,2,3,4,5),1,"cayley", "distances")
rmm(2,c(1,2,3,4,5),1,"hamming", "distances")
rmm(2,c(1,2,3,4,5),1,"ulam", "distances")
rmm(2,c(1,2,3,4,5),1,"kendall", "multistage")
rmm(2,c(1,2,3,4,5),1,"cayley", "multistage")

Example output

Loading required package: Rcpp
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    2    5    4    3
[2,]    1    2    3    5    4
     [,1] [,2] [,3] [,4] [,5]
[1,]    3    1    4    5    2
[2,]    1    2    4    3    5
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    2    3    4    5
[2,]    3    5    2    4    1
     [,1] [,2] [,3] [,4] [,5]
[1,]    4    2    1    5    3
[2,]    1    4    2    3    5
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    2    4    3    5
[2,]    2    1    5    3    4
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    4    3    2    5
[2,]    4    1    2    3    5

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

Related to rmm in PerMallows...