Learn R Programming

PerMallows (version 1.14)

rgmm: Sample a Generalized Mallows Model

Description

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

Usage

rgmm(n, sigma0, theta, dist.name = "kendall", sampling.method = "multistage")

Value

A matrix contaning a sample of permutations from the specified ditribution

Arguments

n

the number of permutations to be generated

sigma0

central permuation of the GMM

theta

dispersion parameter vector of the GMM

dist.name

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

sampling.method

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

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

Run this code
rgmm(2,c(1,2,3,4,5),c(1,1,1,1),"kendall", "multistage")
rgmm(2,c(1,2,3,4,5),c(1,1,1,1),"cayley", "multistage")
rgmm(2,c(1,2,3,4,5),c(1,1,1,1,1),"hamming", "multistage")
rgmm(2,c(1,2,3,4,5),c(1,1,1,1),"cayley", "gibbs")
rgmm(2,c(1,2,3,4,5),c(1,1,1,1,1),"hamming", "gibbs")

Run the code above in your browser using DataLab