Learn R Programming

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

PerMallows (version 1.3)

Permutations and Mallows distributions

Description

This package 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 in 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

91

Version

1.3

License

GPL (>= 2)

Maintainer

Ekhine Irurozki

Last Published

July 3rd, 2014

Functions in PerMallows (1.3)

cycles2permutation

Get the permutation given the cycles
data.order

Sample of permutations
dmm

Calculate the probability of a permutation in a MM
permutation2decomposition

Get the decomposition vector
read.permutation.file

Read a text file with a collection of permtuations
data

Sample of permutations
distance

Compute the distance between permutations
count.perms.fixed.points

Count permutations with a given number of fixed points
data.apa

Sample of permutations APA
count.derangements

Count derangements
freq.matrix

Compute the frequency matrix
r.perms.cycles

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

Learn a Generalized Mallows Model
cycle2str

Friendly display the cycles
decomposition2permutation

Get a permutation consistent with a decomposition vector
expectation.gmm

Compute the expected distance, GMM under the Hamming distance
generate.aux.files

Generates the files for Ulam
data.3

Sample of permutations
r.dist.d

Generate a collection of permutations at a given distance
swap

Swap two items of a permutation
compose

Compose permutations
identity.permutation

Generate identity the permutation
count.perms.cycles

Count permutations with a given number of cycles
rmm

Sample a Mallows Model
data.2

Sample of permutations
inversion.at

Inversion operator
insert.at

Insert operator
r.derangement

Generate a collection of derangements
expectation.mm

Compute the expected distance, MM under the Hamming distance
runif.permutation

Random permutation
data.1

Sample of permutations
marginal

Compute the marginal probability, GMM under the Hamming distance
permutations.of

Generate every permutation of perm.length item
order.ratings

Convert rating to permutation
inverse.permutation

Generate inverse permutation
rgmm

Sample a Generalized Mallows Model
permutation2cycles

Decompose a permutation in a set of cycles
count.perms.distance

Count permutations at a distance
datapos

Sample of permutations
lmm

Learn a Mallows Model
is.permutation

Check if its argument is a permutation
count.perms.unfixed.points.gtet

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

Calculate the probability of a permutation in a GMM