MyNixOS website logo
Description

Nested Sequential Monte Carlo for the Bayesian Mallows Model.

Provides nested sequential Monte Carlo algorithms for performing sequential inference in the Bayesian Mallows model, which is a widely used probability model for rank and preference data. The package implements the SMC2 (Sequential Monte Carlo Squared) algorithm for handling sequentially arriving rankings and pairwise preferences, including support for complete rankings, partial rankings, and pairwise comparisons. The methods are based on Sorensen (2025) <doi:10.1214/25-BA1564>.

BayesMallowsSMC2

R-CMD-check

BayesMallowsSMC2 provides functions for performing sequential inference in the Bayesian Mallows model using the SMC2 algorithm (Sørensen et al. 2025).

Installation

You can install the development version of BayesMallowsSMC2 from GitHub with:

# install.packages("devtools")
devtools::install_github("osorensen/BayesMallowsSMC2")

Example

Here is a basic example using the included complete_rankings dataset:

library(BayesMallowsSMC2)

# Fit the model with complete rankings
set.seed(123)
mod <- compute_sequentially(
  complete_rankings,
  hyperparameters = set_hyperparameters(n_items = 5),
  smc_options = set_smc_options(n_particles = 100, n_particle_filters = 1)
)

# Show model info
mod
#> BayesMallowsSMC2 Model
#> ======================
#> 
#> Number of particles:      100
#> Number of timepoints:     100
#> Number of items:          5
#> Number of clusters:       1
#> 
#> Log marginal likelihood:  -472.34
#> Final ESS:                63.55
#> Resampling events:        5/100

Posterior Summaries

We can visualize the posterior distributions of the parameters:

# Posterior distribution of alpha (dispersion parameter)
plot(mod, parameter = "alpha")
# Posterior distribution of rho (ranking positions)
plot(mod, parameter = "rho", items = c(1, 2, 3))

References

Sørensen, Øystein, Anja Stein, Waldir Leoncio Netto, and David S. Leslie. 2025. “Sequential Rank and Preference Learning with the Bayesian Mallows Model.” Bayesian Analysis, 1–26. https://doi.org/10.1214/25-BA1564.

Metadata

Version

0.2.1

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows