Learn R Programming

⚠️There's a newer version (1.14) of this package.Take me there.

PerMallows (version 1.8)

Permutations and Mallows Distributions

Description

Includes functions to work with the Mallows, Generalized Mallows and Weighted Mallows Models. The considered distances are Kendall's-tau, Cayley, Hamming and Ulam and it includes functions for making inference, sampling and learning such distributions, some of which are novel in the literature. As a by-product, PerMallows also includes operations for permutations, paying special attention to those related with the Kendall's-tau, Cayley, Ulam and Hamming distances and the random generation of permutations.

Copy Link

Version

Install

install.packages('PerMallows')

Monthly Downloads

375

Version

1.8

License

GPL (>= 2)

Maintainer

Ekhine Irurozki

Last Published

January 27th, 2015

Functions in PerMallows (1.8)

cycles2permutation

Get the permutation given the cycles
freq.matrix

Compute the frequency matrix
data.order

Sample of permutations
compose

Compose permutations
dgmm

Calculate the probability of a permutation in a GMM
count.perms.cycles

Count permutations with a given number of cycles
lgmm.theta

MLE for theta - Generalized Mallows Model
decomposition2permutation

Get a permutation consistent with a decomposition vector
count.perms.fixed.points

Count permutations with a given number of fixed points
identity.permutation

Generate identity the permutation
inverse.permutation

Generate inverse permutation
rmm

Sample a Mallows Model
inversion.at

Inversion operator
perm.sample.med

Sample of permutations
count.derangements

Count derangements
read.permutation.file

Read a text file with a collection of permtuations
permutations.of

Generate every permutation of perm.length item
data.apa

Sample of permutations APA
expectation.gmm

Compute the expected distance, GMM under the Hamming distance
cycle2str

Friendly display the cycles
lgmm

Learn a Generalized Mallows Model
expectation.mm

Compute the expected distance, MM under the Hamming distance
r.dist.d

Generate a collection of permutations at a given distance
permutation2cycles

Decompose a permutation in a set of cycles
r.derangement

Generate a collection of derangements
lmm

Learn a Mallows Model
r.perms.cycles

Generate a collection of permutations with a given number of cycles
marginal

Compute the marginal probability, GMM under the Hamming distance
perm.sample.small

Sample of permutations
count.perms.distance

Count permutations at a distance
lmm.theta

MLE for theta - Mallows Model
swap

Swap two items of a permutation
insert.at

Insert operator
permutation2decomposition

Get the decomposition vector
maxi.dist

Get the maximum value of the distance ebtween permutations
runif.permutation

Random permutation
rgmm

Sample a Generalized Mallows Model
is.permutation

Check if its argument is a permutation
generate.aux.files

Generates the files for Ulam
order.ratings

Convert rating to permutation
count.perms.unfixed.points.gtet

Count permutations with at least a given number of unfixed points
distance

Compute the distance between permutations
dmm

Calculate the probability of a permutation in a MM