-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.qmd
More file actions
160 lines (121 loc) · 5.46 KB
/
Copy pathREADME.qmd
File metadata and controls
160 lines (121 loc) · 5.46 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
---
format: gfm
---
<!-- README.md is generated from README.qmd. Please edit that file -->
```{r}
#| label: setup
#| echo: false
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# varicella <img src="man/figures/logo.png" width="200px" alt="epiworld logo" align="right">
<!-- badges: start -->
```{=markdown}
[](https://github.com/EpiForeSITE)
[](https://CRAN.R-project.org/package=varicella)
[](https://github.com/UofUEpiBio/varicella/actions/workflows/r.yml)
[](https://cran.r-project.org/package=varicella)
[](https://github.com/UofUEpiBio/varicella/blob/master/LICENSE.md)
[](https://app.codecov.io/gh/UofUEpiBio/varicella)
[](https://CRAN.R-project.org/package=varicella)
```
<!-- badges: end -->
## Overview
The **varicella** package is a specialized spinoff from [epiworldR](https://github.com/UofUEpiBio/epiworldR), focusing exclusively on varicella epidemiological models. This package provides fast, agent-based models (ABMs) for studying varicella transmission dynamics, vaccination strategies, and intervention policies.
Built on the powerful [epiworld](https://github.com/UofUEpiBio/epiworld) C++ library, these models leverage the speed and flexibility of epiworldR while providing specialized functionality for varicella outbreak modeling.
## Features
- **Fast simulation**: Leverages the high-performance C++ backend from epiworld
- **Specialized varicella models**: Three distinct models tailored for different scenarios
- **Flexible interventions**: Support for vaccination, quarantine, isolation, and contact tracing
- **Population mixing**: Models can account for different population groups with varying contact patterns
- **Risk-based strategies**: Advanced models support risk-stratified quarantine policies
## Models Included
Currently, the package includes three a single model:
1. **ModelVaricellaSchool**: A SLIHR (Susceptible-Latent-Infectious-Hospitalized-Recovered) model designed for school settings with isolation and quarantine policies.
## Installation
You can install the varicella package from GitHub:
```r
# install.packages("devtools")
devtools::install_github("UofUEpiBio/varicella")
```
Or from <a href="https://uofuepibio.r-universe.dev/"
target="_blank">R-universe</a> (recommended for the latest development
version):
``` r
install.packages(
'varicella',
repos = c(
'https://uofuepibio.r-universe.dev',
'https://cloud.r-project.org'
)
)
```
## Quick Example
Here's a simple example using the ModelVaricellaSchool:
```{r}
#| label: example
library(varicella)
# Create a varicella model for a school with 500 students
model_school <- ModelVaricellaSchool(
n = 500,
contact_rate = 10 / .9 / 4, # R0 of 10
prevalence = 1,
prop_vaccinated = 0.70,
quarantine_period = -1,
vax_efficacy = 0.97
)
# Run the simulation
run_multiple(
model_school,
ndays = 200,
seed = 1912,
nsims = 400,
saver = make_saver("outbreak_size"),
nthreads = 4L
)
```
We can take a quick look at the last run using the `summary()` function:
```{r}
# View results
summary(model_school)
```
And we can extract the results (outbreak size in this case), using the function `run_multiple_get_results()`:
```{r}
#| label: plot-outcome
ans <- run_multiple_get_results(model_school)[[1]]
ans <- subset(ans, date == max(date))$outbreak_size
table(ans) |>
prop.table() |>
knitr::kable(
col.names = c("Outbreak Size", "Proportion of Simulations"),
digits = 3,
caption = "Distribution of outbreak sizes across 400 simulations"
)
```
## Relationship to epiworldR
This package is a spinoff from epiworldR, which provides a comprehensive framework for agent-based epidemiological models. While epiworldR includes many different disease models (SIR, SEIR, SIS, etc.), the varicella package focuses specifically on varicella-related models with specialized features for:
- Varicella-specific disease progression (incubation, prodromal, and rash periods)
- School-based outbreak scenarios
- Vaccination coverage and efficacy
- Quarantine and isolation policies
- Contact tracing strategies
- Risk-stratified interventions
For general-purpose epidemiological modeling or other disease types, please see the [epiworldR package](https://github.com/UofUEpiBio/epiworldR).
## Citation
If you use the varicella package in your research, please cite both this package and epiworldR:
```r
citation("varicella")
citation("epiworldR")
```
## Contributing
Contributions are welcome! Please see the [`varicella` development guidelines](https://github.com/UofUEpiBio/varicella/blob/main/DEVELOPMENT.md) for information on how to contribute.
## Acknowledgments
This project was made possible by cooperative agreement
CDC-RFA-FT-23-0069 from the CDC’s Center for Forecasting and Outbreak
Analytics. Its contents are solely the responsibility of the authors and
do not necessarily represent the official views of the Centers for
Disease Control and Prevention.