https://github.com/rowlandseymour/bsbt
Bayesian Spatial Bradley--Terry
https://github.com/rowlandseymour/bsbt
bayesian-inference bradley-terry comparative-judgement preference-learning
Last synced: 7 months ago
JSON representation
Bayesian Spatial Bradley--Terry
- Host: GitHub
- URL: https://github.com/rowlandseymour/bsbt
- Owner: rowlandseymour
- License: lgpl-3.0
- Created: 2020-05-29T07:42:42.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-11-24T11:53:57.000Z (over 2 years ago)
- Last Synced: 2025-10-22T04:59:01.977Z (7 months ago)
- Topics: bayesian-inference, bradley-terry, comparative-judgement, preference-learning
- Language: R
- Homepage:
- Size: 44.3 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# BSBT
----
## Bayesian Spatial Bradley--Terry
[](https://CRAN.R-project.org/package=BSBT)
[](https://github.com/rowlandseymour/BSBT/actions)
----
📦 The `BSBT` R package allows you to fit the Bayesian Spatial Bradley--Terry model to comparative judgement data sets. The package estimates the quality of each object in the data set based on the observed comparisons. The package includes functions to construct the prior distribution covariance matrix from a network or set of coordinates. The package also contains functions to run a number of different MCMC algorithms to estimate the level of deprivation in each aobject in the data set. Also included is a comparative judgement data set on deprivation in Dar es Salaam, Tanzania.
## Installation
You can install `BSBT` by calling the following commands:
```{r}
install.packages("BSBT")
#devtools::install_github("rowlandseymour/BSBT", dependencies = TRUE) #for development version
```
## Creating a Network from a Set of Areas
The first step is to create a network from the set of areas. Here's an example of a network made from Local Authority Areas in the England:

There are two ways to do this in `BSBT`. The first is to construct an adjacency matrix, which describes which areas are neighbours. This can then be fed into `constrained_adjacent_covariance_function`. The second way is to use coordinates which can be used with`constrained_covariance_matrix`. This uses the Euclidean distance metric.
## Fitting the Model
The `BSBT` package uses MCMC the estimate the model parameters. The MCMC can be run by calling the `run_mcmc` function. This make take some time, up to a few hours, depending on how many areas there are in the model. Here are the results of the method applied to a comparative judgement data set in Tanzania:

## Data
In the package, there is a comparative judgement data set collected in Dar es Salaam, Tanzania. It includes over 75,000 comparisons, where citizens where are to compare subwards in the city based on deprivation. Also included are shapefiles for the 452 subwards. These can be accessed by calling `data(dar.comparisons, package = "BSBT")` and `data(dar.shapefiles, package = "BSBT")`.
There is also code for simulating comparative judgement data given the underlying levels of deprivation. More information can be found by calling `?BSBT::simulate_contests`
## The Package in Action
R. G. Seymour, D. Sirl, S. Preston, I. L. Dryden, M. J. A. Ellis, B. Perrat, & J. Goulding. (2020). The Bayesian Spatial Bradley–Terry Model: Urban Deprivation Modeling in Tanzania. [arXiv:2010.14128](https://arxiv.org/abs/2010.14128).
Seymour, R. G., Sirl, D, Preston, S & Goulding, J 2023, Multi-Level Spatial Comparative Judgement Models To Map Deprivation. in Proceedings of the Joint Statistical Meetings 2023. Zenodo, Joint Statistical Meetings 2023. https://doi.org/10.5281/zenodo.8314257
R. G. Seymour, A. Nyarko-Agyei, H. R. McCabe, K. Severn, T. Kypraios, D. Sirl, A. Taylor. (2023). Comparative Judgement Modeling to Map Forced Marriage at Local Levels. [arXiv:2212.01202](https://arxiv.org/abs/2212.01202)
[Using citizen knowledge to model urban deprivation](https://github.com/rowlandseymour/Talks/blob/master/20_12_Universitas21_Talk.pptx) @ Universitas21 Early Career Researcher Workshop 2020 - Modern Slavery, Forced Labour and Human Trafficking: Research Roadmaps to 2030. Deceber 2020.
## Acknowledgements
This work is supported by the Engineering and Physical Sciences Research Council [grant numbers EP/T003928/1, EP/R513283/1], the Economic and Social Sciences Research Council [ES/V015370/1], the Research England Policy Support Fund and the Big East African Data Science research group at the University of Nottingham.
The comparative judgement dataset was collected by Madeleine Ellis, James Goulding, Bertrand Perrat, Gavin Smith and Gregor Engelmann. We gratefully acknowledge the Rights Lab at the University of Nottingham for supporting funding for the comprehensive ground truth survey. We also acknowledge Humanitarian Street Mapping Team (HOT) for providing a team of experts in data collection to facilitate the surveys. This fieldwork was also supported by the EPSRC Horizon Centre for Doctoral Training - My Life in Data (EP/L015463/1) and by EPSRC grant Neodemographics (EP/L021080/1).

