11---
22output : github_document
3+ bibliography : inst/REFERENCES.bib
34---
45
56<!-- README.md is generated from README.Rmd. Please edit that file -->
@@ -19,7 +20,7 @@ knitr::opts_chunk$set(
1920[ ![ R-CMD-check] ( https://github.com/osorensen/BayesMallowsSMC2/actions/workflows/R-CMD-check.yaml/badge.svg )] ( https://github.com/osorensen/BayesMallowsSMC2/actions/workflows/R-CMD-check.yaml )
2021<!-- badges: end -->
2122
22- BayesMallowsSMC2 provides functions for performing sequential inference in the Bayesian Mallows model using the SMC2 algorithm.
23+ BayesMallowsSMC2 provides functions for performing sequential inference in the Bayesian Mallows model using the SMC2 algorithm [ @ 10 .1214/25-BA1564 ] .
2324
2425## Installation
2526
@@ -30,8 +31,43 @@ You can install the development version of BayesMallowsSMC2 from [GitHub](https:
3031devtools :: install_github(" osorensen/BayesMallowsSMC2" )
3132```
3233
33- ## Usage
34+ ## Example
3435
35- This package is under development, and is not yet well documented. For examples on how to use it, see the code in the OSF repository https://osf.io/pquk4/ .
36+ Here is a basic example using the included ` complete_rankings ` dataset:
3637
38+ ``` {r example}
39+ library(BayesMallowsSMC2)
40+
41+ # Fit the model with complete rankings
42+ set.seed(123)
43+ mod <- compute_sequentially(
44+ complete_rankings,
45+ hyperparameters = set_hyperparameters(n_items = 5),
46+ smc_options = set_smc_options(n_particles = 100, n_particle_filters = 1)
47+ )
48+
49+ # Print model summary
50+ print(mod)
51+ ```
52+
53+ ### Posterior Summaries
54+
55+ We can visualize the posterior distributions of the parameters:
56+
57+ ``` {r posterior-alpha}
58+ # Posterior distribution of alpha (dispersion parameter)
59+ plot(mod, parameter = "alpha")
60+ ```
61+
62+ ``` {r posterior-tau}
63+ # Posterior distribution of tau (precision parameter)
64+ plot(mod, parameter = "tau")
65+ ```
66+
67+ ``` {r posterior-rho}
68+ # Posterior distribution of rho (ranking positions)
69+ plot(mod, parameter = "rho", items = c(1, 2, 3))
70+ ```
71+
72+ ## References
3773
0 commit comments