Skip to content

Commit

Permalink
Update vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
pwinskill committed Sep 3, 2024
1 parent c8a00a2 commit 75f3d32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions vignettes/Advanced_calibration.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ produce a vector of annual average estimates of prevalence in 2-10 year olds:
```{r}
annual_pfpr_summary <- function(x){
year <- ceiling(x$timestep / 365)
pfpr <- x$n_detect_730_3650 / x$n_730_3650
pfpr <- x$n_detect_lm_730_3650 / x$n_730_3650
tapply(pfpr, year, mean)
}
```
Expand Down Expand Up @@ -59,7 +59,7 @@ out <- calibrate(
parameters$human_population <- 5000
parameters <- set_equilibrium(parameters, init_EIR = out)
raw <- run_simulation(parameters$timesteps + 100, parameters = parameters)
raw$pfpr <- raw$n_detect_730_3650 / raw$n_730_3650
raw$pfpr <- raw$n_detect_lm_730_3650 / raw$n_730_3650
ggplot() +
geom_point(aes(x = 365 * (0:2 + 0.5), y = target), col = "dodgerblue", size = 4) +
Expand Down Expand Up @@ -120,7 +120,7 @@ weighted_target <- target * weights
weighted_annual_pfpr_summary <- function(x, w = weights){
year <- ceiling(x$timestep / 365)
pfpr <- x$n_detect_730_3650 / x$n_730_3650
pfpr <- x$n_detect_lm_730_3650 / x$n_730_3650
tapply(pfpr, year, mean) * w
}
Expand All @@ -147,7 +147,7 @@ out <- calibrate(
parameters$human_population <- 5000
parameters <- set_equilibrium(parameters, init_EIR = out)
raw <- run_simulation(parameters$timesteps + 100, parameters = parameters)
raw$pfpr <- raw$n_detect_730_3650 / raw$n_730_3650
raw$pfpr <- raw$n_detect_lm_730_3650 / raw$n_730_3650
ggplot() +
geom_point(aes(x = 365 * (0:2 + 0.5), y = target), col = "dodgerblue", size = 4) +
Expand Down
2 changes: 1 addition & 1 deletion vignettes/Basic_calibration.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Ok, we've calibrated. Lets run the calibrated model and see how we did.
parameters$human_population <- 5000
parameters <- set_equilibrium(parameters, init_EIR = out)
raw <- run_simulation(parameters$timesteps + 100, parameters = parameters)
pfpr <- raw$n_detect_730_3650 / raw$n_730_3650
pfpr <- raw$n_detect_lm_730_3650 / raw$n_730_3650
pd <- data.frame(time = 1:(parameters$timesteps + 100), pfpr = pfpr)
Expand Down

0 comments on commit 75f3d32

Please sign in to comment.