Learn R Programming

BayesMallowsSMC2 (version 0.2.1)

print.BayesMallowsSMC2: Print Method for BayesMallowsSMC2 Objects

Description

Prints a summary of a BayesMallowsSMC2 object returned by compute_sequentially().

Usage

# S3 method for BayesMallowsSMC2
print(x, ...)

Value

Invisibly returns the input object x.

Arguments

x

An object of class BayesMallowsSMC2.

...

Additional arguments (currently unused).

Details

The print method displays key information about the fitted Bayesian Mallows model, including:

  • Number of particles

  • Number of timepoints

  • Number of items

  • Number of clusters

  • Log marginal likelihood

  • Final effective sample size (ESS)

  • Number of resampling events

Examples

Run this code
# Fit a 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)
)

# Print the model
print(mod)

# or simply
mod

Run the code above in your browser using DataLab