Skip to content

Commit

Permalink
fix the bugs identified by CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitejohnson committed Jul 9, 2024
1 parent b1d279a commit 12a8b06
Show file tree
Hide file tree
Showing 15 changed files with 162 additions and 100 deletions.
11 changes: 11 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ importFrom(lubridate,ymd)
importFrom(posterior,as_draws_list)
importFrom(posterior,subset_draws)
importFrom(rlang,sym)
importFrom(stats,dnbinom)
importFrom(stats,dweibull)
importFrom(stats,ecdf)
importFrom(stats,plogis)
importFrom(stats,qlogis)
importFrom(stats,rlnorm)
importFrom(stats,rnbinom)
importFrom(stats,rnorm)
importFrom(stats,rt)
importFrom(stats,sd)
importFrom(stats,time)
importFrom(tidybayes,spread_draws)
importFrom(tidybayes,stat_halfeye)
importFrom(tidybayes,stat_slab)
Expand Down
30 changes: 27 additions & 3 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' \item{site_pop}{The population size of the wastewater catchment area
#' represented by the site variable}
#' }
#' @source generate_simulated_data.R
#' @source vignette_data.R
"ww_data"


Expand Down Expand Up @@ -66,7 +66,7 @@
#' \item{state_pop}{The number of people contributing to the daily hospital
#' admissions}
#' }
#' @source generate_simulated_data.R
#' @source vignette_data.R
"hosp_data"

#' Example hospital admissions dataset for evaluation
Expand All @@ -90,5 +90,29 @@
#' \item{state_pop}{The number of people contributing to the daily hospital
#' admissions}
#' }
#' @source generate_simulated_data.R
#' @source vignette_data.R
"hosp_data_eval"

#' COVID-19 post-Omicron generation interval probability mass function
#'
#' \describe{
#' A vector that sums to 1, with each element representing the daily
#' probability of secondary onward transmission occurring on that day. The
#' first element of this vector represents the day after primary transmission
#' occurred, it is assumed to be impossible for primary and secondary
#' transmission to occur on the same day.
#' }
#' @source covid_pmfs.R
"generation_interval"

#' COVID-19 time delay distribution from infection to hospital admission
#'
#' \describe{
#' A vector that sums to 1, with each element representing the daily
#' probabilty of transitioning from infected to hospitalized, conditioned on
#' being infected and eventually ending up hospitalized. The first element
#' represents the probability of being infected and admitted to the hospital
#' on the same day
#' }
#' @source covid_pmfs.R
"inf_to_hosp"
5 changes: 4 additions & 1 deletion R/generate_simulated_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@
#' # different labs
#' sim_data <- generate_simulated_data(
#' n_sites = 6,
#' site = c(rep(1, 4), rep(2, 2))
#' site = c(1, 2, 3, 4, 5, 6, 6),
#' lab = c(1, 1, 1, 1, 2, 2, 3),
#' ww_pop_sites = c(1e5, 4e5, 2e5, 1.5e5, 5e4, 3e5),
#' pop_size = 2e6
#' )
#' hosp_data <- sim_data$hosp_data
#' ww_data <- sim_data$ww_data
Expand Down
2 changes: 1 addition & 1 deletion R/get_stan_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ get_subpop_data <- function(add_auxiliary_site,

#' Get count data integer sizes for stan
#'
#' @param input_cout_data a dataframe with the input count data
#' @param input_count_data a dataframe with the input count data
#' @param forecast_date string indicating the forecast date
#' @param forecast_horizon integer indicating the number of days to make a
#' forecast for
Expand Down
1 change: 0 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ convert_to_logsd <- function(mean, sd) {
#' @export
#' @examples
#' to_simplex(c(1, 1, 1))
#' @noRd
to_simplex <- function(vector) {
return(vector / sum(vector))
}
2 changes: 2 additions & 0 deletions R/wwinference-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
#' @importFrom posterior subset_draws as_draws_list
#' @importFrom fs path_package
#' @importFrom rlang sym
#' @importFrom stats dnbinom dweibull ecdf plogis qlogis rlnorm rnbinom rnorm
#' rt sd time
NULL
5 changes: 4 additions & 1 deletion man/generate_simulated_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions man/generation_interval.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/get_count_data_sizes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 4 additions & 32 deletions man/hosp_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 4 additions & 25 deletions man/hosp_data_eval.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions man/inf_to_hosp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions man/to_simplex.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/ww_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 12a8b06

Please sign in to comment.