Skip to content

Commit

Permalink
remove author tags [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Mar 1, 2024
1 parent 97e07cf commit 37ccab5
Show file tree
Hide file tree
Showing 92 changed files with 1 addition and 352 deletions.
1 change: 0 additions & 1 deletion R/adjust.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#' @inheritParams sample_approx_dist
#' @importFrom data.table setorder data.table data.table
#' @importFrom lubridate wday
#' @author Sam Abbott
#' @examples
#' \donttest{
#' # define example cases
Expand Down
1 change: 0 additions & 1 deletion R/checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#' assert_numeric
#' @importFrom rlang arg_match
#' @return Called for its side effects.
#' @author James M. Azam
#' @keywords internal
check_reports_valid <- function(reports, model) {
# Check that the case time series (reports) is a data frame
Expand Down
15 changes: 0 additions & 15 deletions R/create.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#' @inheritParams estimate_infections
#' @importFrom data.table copy merge.data.table setorder setDT frollsum
#' @return A cleaned data frame of reported cases
#' @author Sam Abbott
#' @author Lloyd Chapman
#' @export
#' @examples
#' create_clean_reported_cases(example_confirmed, 7)
Expand Down Expand Up @@ -84,7 +82,6 @@ create_clean_reported_cases <- function(reported_cases, horizon = 0,
#' start of the time series be filtered out.
#'
#' @return A data frame without NA values, with two columns: confirm (number)
#' @author Sebastian Funk
#' @importFrom data.table setDT
#' @keywords internal
create_complete_cases <- function(cases) {
Expand Down Expand Up @@ -116,7 +113,6 @@ create_complete_cases <- function(cases) {
#' @importFrom runner mean_run
#' @return A `<data.frame>` for shifted reported cases
#' @export
#' @author Sam Abbott
#' @examples
#' create_shifted_cases(example_confirmed, 7, 14, 7)
create_shifted_cases <- function(reported_cases, shift,
Expand Down Expand Up @@ -185,7 +181,6 @@ create_shifted_cases <- function(reported_cases, shift,
#' @param delay Numeric mean delay
#' @importFrom rlang arg_match
#' @return A list containing a logical called fixed and an integer called from
#' @author Sam Abbott
create_future_rt <- function(future = "latest", delay = 0) {
out <- list(fixed = FALSE, from = 0)
if (is.character(future)) {
Expand Down Expand Up @@ -226,7 +221,6 @@ create_future_rt <- function(future = "latest", delay = 0) {
#' @return A list of settings defining the time-varying reproduction number
#' @inheritParams create_future_rt
#' @export
#' @author Sam Abbott
#' @examples
#' # default Rt data
#' create_rt_data()
Expand Down Expand Up @@ -293,7 +287,6 @@ create_rt_data <- function(rt = rt_opts(), breakpoints = NULL,
#' @importFrom data.table fcase
#' @return A list of settings defining the Gaussian process
#' @export
#' @author Sam Abbott
#' @examples
#' create_backcalc_data(backcalc = backcalc_opts())
create_backcalc_data <- function(backcalc = backcalc_opts()) {
Expand Down Expand Up @@ -322,7 +315,6 @@ create_backcalc_data <- function(backcalc = backcalc_opts()) {
#' @seealso [gp_opts()]
#' @return A list of settings defining the Gaussian process
#' @export
#' @author Sam Abbott
#' @examples
#' # define input data required
#' data <- list(
Expand Down Expand Up @@ -392,7 +384,6 @@ create_gp_data <- function(gp = gp_opts(), data) {
#' @return A list of settings ready to be passed to stan defining
#' the Observation Model
#' @export
#' @author Sam Abbott
#' @examples
#' dates <- seq(as.Date("2020-03-15"), by = "days", length.out = 15)
#' # default observation model data
Expand Down Expand Up @@ -448,8 +439,6 @@ create_obs_model <- function(obs = obs_opts(), dates) {
#' @importFrom stats lm
#' @importFrom purrr safely
#' @return A list of stan data
#' @author Sam Abbott
#' @author Sebastian Funk
#' @export
#' @examples
#' create_stan_data(
Expand Down Expand Up @@ -539,8 +528,6 @@ create_stan_data <- function(reported_cases, seeding_time,
#' @importFrom truncnorm rtruncnorm
#' @importFrom data.table fcase
#' @export
# @author Sam Abbott
# @author Sebastian Funk
create_initial_conditions <- function(data) {
init_fun <- function() {
out <- list()
Expand Down Expand Up @@ -656,7 +643,6 @@ create_initial_conditions <- function(data) {
#' @importFrom utils modifyList
#'
#' @return A list of stan arguments
#' @author Sam Abbott
#' @export
#' @examples
#' # default settings
Expand Down Expand Up @@ -707,7 +693,6 @@ create_stan_args <- function(stan = stan_opts(),
##' @param weight Numeric, weight associated with delay priors; default: 1
##' @return A list of variables as expected by the stan model
##' @importFrom purrr list_transpose map
##' @author Sebastian Funk
create_stan_delays <- function(..., weight = 1) {
dot_args <- list(...)
## combine delays
Expand Down
17 changes: 0 additions & 17 deletions R/dist.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#'
#' @return A vector of samples or a probability distribution.
#' @export
#' @author Sam Abbott
#' @author Sebastian Funk
#' @examples
#'
#' ## Exponential model
Expand Down Expand Up @@ -197,7 +195,6 @@ dist_skel <- function(n, dist = FALSE, cum = TRUE, model,
#' be printed.
#'
#' @return A stan fit of an interval censored distribution
#' @author Sam Abbott
#' @export
#' @inheritParams stan_opts
#' @examples
Expand Down Expand Up @@ -311,7 +308,6 @@ dist_fit <- function(values = NULL, samples = 1000, cores = 1,
#' @export
#' @inheritParams dist_skel
#' @inheritParams lognorm_dist_def
#' @author Sam Abbott
#' @examples
#' # using estimated shape and scale
#' def <- gamma_dist_def(
Expand Down Expand Up @@ -394,7 +390,6 @@ gamma_dist_def <- function(shape, shape_sd,
#' @param to_log Logical, should parameters be logged before use.
#'
#' @return A `<data.table>` defining the distribution as used by [dist_skel()]
#' @author Sam Abbott
#' @importFrom truncnorm rtruncnorm
#' @export
#' @inheritParams dist_skel
Expand Down Expand Up @@ -498,7 +493,6 @@ lognorm_dist_def <- function(mean, mean_sd,
#' data. Maximum delay to allow (added to output but does impact fitting).
#'
#' @return A `<dist_spec>` object summarising the bootstrapped distribution
#' @author Sam Abbott
#' @importFrom purrr list_transpose
#' @importFrom future.apply future_lapply
#' @importFrom rstan extract
Expand Down Expand Up @@ -603,7 +597,6 @@ bootstrapped_dist_fit <- function(values, dist = "lognormal",
#' @param ... Arguments to pass to internal methods.
#'
#' @return A `<dist_spec>` summarising the bootstrapped distribution
#' @author Sam Abbott
#' @export
#' @seealso [bootstrapped_dist_fit()]
#' @examples
Expand Down Expand Up @@ -898,8 +891,6 @@ tune_inv_gamma <- function(lower = 2, upper = 21) {
#' reduces compute requirement but may produce spuriously precise estimates.
#' @return A list of distribution options.
#'
#' @author Sebastian Funk
#' @author Sam Abbott
#' @importFrom rlang warn arg_match
#' @export
#' @examples
Expand Down Expand Up @@ -1084,8 +1075,6 @@ dist_spec <- function(mean, sd = 0, mean_sd = 0, sd_sd = 0,
#' @return A delay distribution representing the sum of the two delays
#' (with class [dist_spec()])
#'
#' @author Sebastian Funk
#' @author Sam Abbott
#' @importFrom stats convolve
dist_spec_plus <- function(e1, e2, tolerance = 0.001) {
## process delay distributions
Expand Down Expand Up @@ -1125,7 +1114,6 @@ dist_spec_plus <- function(e1, e2, tolerance = 0.001) {
#' @return A delay distribution representing the sum of the two delays
#' (with class [dist_spec()])
#' @inheritParams dist_spec_plus
#' @author Sebastian Funk
#' @method + dist_spec
#' @export
#' @examples
Expand Down Expand Up @@ -1155,7 +1143,6 @@ dist_spec_plus <- function(e1, e2, tolerance = 0.001) {
#'
#' @param ... The delay distributions (from calls to [dist_spec()]) to combine
#' @return Combined delay distributions (with class `<dist_spec>`)
#' @author Sebastian Funk
#' @method c dist_spec
#' @importFrom purrr list_transpose map
c.dist_spec <- function(...) {
Expand Down Expand Up @@ -1185,7 +1172,6 @@ c.dist_spec <- function(...) {
##' @param x The `<dist_spec>` to use
##' @param ... Not used
##' @return A vector of means.
##' @author Sebastian Funk
##' @method mean dist_spec
##' @importFrom utils head
##' @export
Expand Down Expand Up @@ -1237,7 +1223,6 @@ mean.dist_spec <- function(x, ...) {
#' @param x The `<dist_spec>` to use
#' @param ... Not used
#' @return invisible
#' @author Sebastian Funk
#' @method print dist_spec
#' @export
#' @examples
Expand Down Expand Up @@ -1309,7 +1294,6 @@ print.dist_spec <- function(x, ...) {
#' @param ... Additional arguments to pass to `{ggplot}`.
#' @importFrom ggplot2 aes geom_col geom_step facet_wrap vars theme_bw
#' @export
#' @author Sam Abbott
#' @examples
#' #' # A fixed lognormal distribution with mean 5 and sd 1.
#' lognormal <- dist_spec(
Expand Down Expand Up @@ -1393,7 +1377,6 @@ plot.dist_spec <- function(x, ...) {
##' If the given `<dist_spec>` has any uncertainty, it is removed and the
##' corresponding distribution converted into a fixed one.
##' @return A `<dist_spec>` object without uncertainty
##' @author Sebastian Funk
##' @export
##' @param x A `<dist_spec>` object
##' @param strategy Character; either "mean" (use the mean estimates of the
Expand Down
6 changes: 0 additions & 6 deletions R/epinow-internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#' @inheritParams setup_target_folder
#' @inheritParams estimate_infections
#' @return Numeric forecast horizon adjusted for the users intention
#' @author Sam Abbott
#' @export
update_horizon <- function(horizon, target_date, reported_cases) {
if (horizon != 0) {
Expand All @@ -25,7 +24,6 @@ update_horizon <- function(horizon, target_date, reported_cases) {
#' @inheritParams setup_target_folder
#' @inheritParams epinow
#' @return No return value, called for side effects
#' @author Sam Abbott
#' @export
save_input <- function(reported_cases, target_folder) {
if (!is.null(target_folder)) {
Expand All @@ -51,7 +49,6 @@ save_input <- function(reported_cases, target_folder) {
#' be returned.
#'
#' @seealso estimate_infections
#' @author Sam Abbott
#' @inheritParams setup_target_folder
#' @inheritParams estimate_infections
#' @return No return value, called for side effects
Expand Down Expand Up @@ -88,7 +85,6 @@ save_estimate_infections <- function(estimates, target_folder = NULL,
#'
#' @return A list of samples and summarised estimates of estimated cases by
#' date of report.
#' @author Sam Abbott
#' @export
#' @importFrom data.table := rbindlist
estimates_by_report_date <- function(estimates, CrIs = c(0.2, 0.5, 0.9),
Expand Down Expand Up @@ -134,7 +130,6 @@ estimates_by_report_date <- function(estimates, CrIs = c(0.2, 0.5, 0.9),
#' @inheritParams setup_target_folder
#'
#' @return No return value, called for side effects
#' @author Sam Abbott
#' @export
copy_results_to_latest <- function(target_folder = NULL, latest_folder = NULL) {
if (!is.null(target_folder)) {
Expand Down Expand Up @@ -175,7 +170,6 @@ copy_results_to_latest <- function(target_folder = NULL, latest_folder = NULL) {
#' @inheritParams save_estimate_infections
#'
#' @return A list of output as returned by `epinow`
#' @author Sam Abbott
#' @export
construct_output <- function(estimates,
estimated_reported_cases,
Expand Down
2 changes: 0 additions & 2 deletions R/epinow.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#'
#' @return A list of output from estimate_infections with additional elements
#' summarising results and reporting errors if they have occurred.
#' @author Sam Abbott
#' @export
#' @seealso [estimate_infections()] [forecast_infections()] [regional_epinow()]
#' @inheritParams setup_target_folder
Expand All @@ -35,7 +34,6 @@
#' @importFrom checkmate assert_string assert_path_for_output
#' assert_date assert_logical
#' @importFrom R.utils isDirectory
#' @author Sam Abbott
#' @examples
#' \donttest{
#' # set number of cores to use
Expand Down
5 changes: 0 additions & 5 deletions R/estimate_infections.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#' @return A list of output including: posterior samples, summarised posterior
#' samples, data used to fit the model, and the fit object itself.
#'
#' @author Sam Abbott
#' @seealso [epinow()] [regional_epinow()] [forecast_infections()]
#' [estimate_truncation()]
#' @inheritParams create_stan_args
Expand Down Expand Up @@ -312,7 +311,6 @@ estimate_infections <- function(reported_cases,
#' @inheritParams fit_model_with_nuts
#' @inheritParams stan_opts
#' @return A stanfit object
#' @author Sam Abbott
init_cumulative_fit <- function(args, samples = 50, warmup = 50,
id = "init", verbose = FALSE,
backend = "rstan") {
Expand Down Expand Up @@ -389,7 +387,6 @@ init_cumulative_fit <- function(args, samples = 50, warmup = 50,
#' @importFrom rstan sflist2stanfit sampling
#' @importFrom rlang abort cnd_muffle
#' @return A stan model object
#' @author Sam Abbott
fit_model_with_nuts <- function(args, future = FALSE, max_execution_time = Inf,
id = "stan") {
args$method <- NULL
Expand Down Expand Up @@ -528,7 +525,6 @@ fit_model_with_nuts <- function(args, future = FALSE, max_execution_time = Inf,
#' @importFrom rstan vb
#' @importFrom rlang abort
#' @return A stan model object
#' @author Sam Abbott
fit_model_with_vb <- function(args, future = FALSE, id = "stan") {
args$method <- NULL
futile.logger::flog.debug(
Expand Down Expand Up @@ -612,7 +608,6 @@ fit_model_with_vb <- function(args, future = FALSE, id = "stan") {
#' @importFrom lubridate days
#' @importFrom futile.logger flog.info
#' @return A list of samples and summarised posterior parameter estimates.
#' @author Sam Abbott
format_fit <- function(posterior_samples, horizon, shift, burn_in, start_date,
CrIs) {
format_out <- list()
Expand Down
6 changes: 0 additions & 6 deletions R/estimate_secondary.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#' estimated secondary observations), `posterior` which contains a summary of
#' the entire model posterior, `data` (a list of data used to fit the
#' model), and `fit` (the `stanfit` object).
#' @author Sam Abbott
#' @export
#' @inheritParams estimate_infections
#' @inheritParams update_secondary_args
Expand Down Expand Up @@ -252,7 +251,6 @@ estimate_secondary <- function(reports,
#' variables: `variable`, `mean`, and `sd`.
#'
#' @return A list as produced by `create_stan_data()`.
#' @author Sam Abbott
#' @export
#' @inheritParams create_stan_args
#' @importFrom data.table as.data.table
Expand Down Expand Up @@ -319,7 +317,6 @@ update_secondary_args <- function(data, priors, verbose = TRUE) {
#'
#' @return A `ggplot` object.
#'
#' @author Sam Abbott
#' @seealso plot estimate_secondary
#' @method plot estimate_secondary
#' @importFrom ggplot2 ggplot aes geom_col geom_point labs scale_x_date
Expand Down Expand Up @@ -395,8 +392,6 @@ plot.estimate_secondary <- function(x, primary = FALSE,
#' @return A `<data.frame>` containing simulated data in the format required by
#' [estimate_secondary()].
#'
#' @author Sam Abbott
#' @author Sebastian Funk
#' @seealso estimate_secondary
#' @inheritParams secondary_opts
#' @importFrom data.table as.data.table copy shift
Expand Down Expand Up @@ -530,7 +525,6 @@ simulate_secondary <- function(data, type = "incidence", family = "poisson",
#' of forecast secondary observation posterior samples, and `forecast` a summary
#' of the forecast secondary observation posterior.
#'
#' @author Sam Abbott
#' @importFrom rstan extract sampling
#' @importFrom data.table rbindlist merge.data.table as.data.table setorderv
#' @importFrom data.table setcolorder copy
Expand Down
3 changes: 0 additions & 3 deletions R/estimate_truncation.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
#' observed data (`last_obs`, useful for plotting and validation), the data
#' used for fitting (`data`) and the fit object (`fit`).
#'
#' @author Sam Abbott
#' @author Sebastian Funk
#' @export
#' @inheritParams calc_CrIs
#' @inheritParams estimate_infections
Expand Down Expand Up @@ -320,7 +318,6 @@ estimate_truncation <- function(obs, max_truncation, trunc_max = 10,
#' @param ... Pass additional arguments to plot function. Not currently in use.
#'
#' @return `ggplot2` object
#' @author Sam Abbott
#' @seealso plot estimate_truncation
#' @method plot estimate_truncation
#' @importFrom ggplot2 ggplot aes geom_col geom_point labs scale_x_date
Expand Down
Loading

0 comments on commit 37ccab5

Please sign in to comment.