-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
75 lines (54 loc) · 1.87 KB
/
README.Rmd
File metadata and controls
75 lines (54 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
output: github_document
bibliography: inst/REFERENCES.bib
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# BayesMallowsSMC2
<!-- badges: start -->
[](https://CRAN.R-project.org/package=BayesMallowsSMC2)
[](https://github.com/osorensen/BayesMallowsSMC2/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
BayesMallowsSMC2 provides functions for performing sequential inference in the Bayesian Mallows model using the SMC2 algorithm [@10.1214/25-BA1564].
## Installation
You can install the released version of BayesMallowsSMC2 from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("BayesMallowsSMC2")
```
Or install the development version of BayesMallowsSMC2 from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("osorensen/BayesMallowsSMC2")
```
## Example
Here is a basic example using the included `complete_rankings` dataset:
```{r example}
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
```
### Posterior Summaries
We can visualize the posterior distributions of the parameters:
```{r posterior-alpha}
# Posterior distribution of alpha (dispersion parameter)
plot(mod, parameter = "alpha")
```
```{r posterior-rho}
# Posterior distribution of rho (ranking positions)
plot(mod, parameter = "rho", items = c(1, 2, 3))
```
## References