View source: R/MSmix_functions_package.R
data_augmentation | R Documentation |
For a given partial ranking matrix, generate all possible full rankings which are compatible with each partially ranked sequence. Partial rankings with at most 10 missing positions and arbitrary patterns of censoring are supported.
data_augmentation(rankings, fill_single_na = TRUE)
rankings |
Integer |
fill_single_na |
Logical: whether single missing positions in the row of |
The data augmentation of a full ranking returns the complete ranking itself arranged in a row vector. The function can be applied on partial observations expressed in ordering format as well. A message informs the user when data augmentation may be heavy.
A list of N
elements corresponding to the matrices of full rankings compatible with each partial sequence.
Crispino M, Mollica C, Astuti V and Tardella L (2023). Efficient and accurate inference for mixtures of Mallows models with Spearman distance. Statistics and Computing, 33(98), DOI: 10.1007/s11222-023-10266-8.
## Example 1. Data augmentation of a single partial top-9 ranking.
data_augmentation(c(3, 7, 5, 1, NA, 4, NA, 8, 2, 6, NA, 9))
## Example 2. Data augmentation of partial ranking matrix with different censoring patterns.
rank_data <- rbind(c(NA, 4, NA, 1, NA),
c(NA, NA, NA, NA, 1),
c(2, NA, 1, NA, 3),
c(4, 2, 3, 5, 1),
c(NA, 4, 1, 3, 2))
data_augmentation(rank_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.