Permutations and Mallows Distributions
Compose Permutations
Count permutations at a distance
Friendly display the cycles
Get the permutation given the cycles
Get a permutation consistent with a decomposition vector
Calculate the probability of a permutation in a GMM
Compute the distance between permutations
Calculate the probability of a permutation in a MM
PerMallows: A Package for Sampling and Estimation in Mallows Models
Compute the expected distance, GMM under the Hamming distance
Compute the expected distance, MM under the Hamming distance
Compute the frequency matrix
Generates the files for Ulam
Generate identity the permutation
Insert operator
Generate inverse permutation
Inversion operator
Check if its argument is a permutation
Learn a Generalized Mallows Model
MLE for theta - Generalized Mallows Model
Learn a Mallows Model
MLE for theta - Mallows Model
Compute the marginal probability, GMM under the Hamming distance
Get the maximum value of the distance ebtween permutations
Convert rating to permutation
Decompose a permutation in a set of cycles
Get the decomposition vector
Generate every permutation of perm.length item
Generate a collection of permutations at a given distance
Read a text file with a collection of permutations
Sample a Generalized Mallows Model
Sample a Mallows Model
Random permutation
Swap two items of a permutation
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).