Learn R Programming

PerMallows (version 1.14)

Permutations and Mallows Distributions

Description

Includes functions to work with the Mallows and Generalized 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. It is also possible to generate random permutations at a given distance, or with a given number of inversions, or cycles, or fixed points or even with a given length on LIS (longest increasing subsequence).

Copy Link

Version

Install

install.packages('PerMallows')

Monthly Downloads

228

Version

1.14

License

GPL (>= 2)

Maintainer

Ekhine Irurozki

Last Published

February 13th, 2025

Functions in PerMallows (1.14)

marginal

Compute the marginal probability, GMM under the Hamming distance
freq.matrix

Compute the frequency matrix
rgmm

Sample a Generalized Mallows Model
lmm

Learn a Mallows Model
lmm.theta

MLE for theta - Mallows Model
rmm

Sample a Mallows Model
runif.permutation

Random permutation
swap

Swap two items of a permutation
maxi.dist

Get the maximum value of the distance ebtween permutations
perm.sample.small

Sample of permutations
perm2cycles

Decompose a permutation in a set of cycles
perm.sample.med

Sample of permutations
read.perms

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

Generate every permutation of perm.length item
order.ratings

Convert rating to permutation
perm2decomp

Get the decomposition vector
lgmm.theta

MLE for theta - Generalized Mallows Model
rdist.perm

Generate a collection of permutations at a given distance
lgmm

Learn a Generalized Mallows Model
dgmm

Calculate the probability of a permutation in a GMM
data.apa

Sample of permutations APA
dmm

Calculate the probability of a permutation in a MM
data.order

Sample of permutations
compose

Compose Permutations
distance

Compute the distance between permutations
cycle2str

Friendly display the cycles
decomp2perm

Get a permutation consistent with a decomposition vector
cycles2perm

Get the permutation given the cycles
count.perms

Count permutations at a distance
generate.aux.files

Generates the files for Ulam
inversion

Inversion operator
is.permutation

Check if its argument is a permutation
expectation.mm

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

Generate identity the permutation
.CAYLEY.DISTANCE

PerMallows: A Package for Sampling and Estimation in Mallows Models
expectation.gmm

Compute the expected distance, GMM under the Hamming distance
inverse.perm

Generate inverse permutation
insert

Insert operator