Skip to content

Commit

Permalink
Reformat {stan} to stan
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmbaazam committed Nov 20, 2023
1 parent 65a9cf0 commit 5921c92
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 42 deletions.
22 changes: 11 additions & 11 deletions R/create.R
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ create_shifted_cases <- function(reported_cases, shift,
#'
#' @description `r lifecycle::badge("stable")`
#' Converts the `future` argument from [rt_opts()] into arguments that can be
#' passed to `{stan}`.
#' passed to stan.
#'
#' @param future A character string or integer. This argument indicates how to
#' set future Rt values. Supported options are to project using the Rt model
Expand Down Expand Up @@ -185,7 +185,7 @@ create_future_rt <- function(future = "latest", delay = 0) {
#'
#' @description `r lifecycle::badge("stable")`
#' Takes the output from [rt_opts()] and converts it into a list understood by
#' `{stan}`.
#' stan.
#' @param rt A list of options as generated by [rt_opts()] defining Rt
#' estimation. Defaults to [rt_opts()]. Set to `NULL` to switch to using back
#' calculation rather than generating infections using Rt.
Expand Down Expand Up @@ -257,7 +257,7 @@ create_rt_data <- function(rt = rt_opts(), breakpoints = NULL,
#'
#' @description `r lifecycle::badge("stable")`
#' Takes the output of [backcalc_opts()] and converts it into a list understood
#' by `{stan}`.
#' by stan.
#'
#' @param backcalc A list of options as generated by [backcalc_opts()] to
#' define the back calculation. Defaults to [backcalc_opts()].
Expand Down Expand Up @@ -285,7 +285,7 @@ create_backcalc_data <- function(backcalc = backcalc_opts()) {
#'
#' @description `r lifecycle::badge("stable")`
#' Takes the output of [gp_opts()] and converts it into a list understood by
#' `{stan}`.
#' stan.
#' @param gp A list of options as generated by [gp_opts()] to define the
#' Gaussian process. Defaults to [gp_opts()]. Set to `NULL` to disable the
#' Gaussian process.
Expand Down Expand Up @@ -357,12 +357,12 @@ create_gp_data <- function(gp = gp_opts(), data) {
#'
#' @description `r lifecycle::badge("stable")`
#' Takes the output of [obs_opts()] and converts it into a list understood
#' by `{stan}`.
#' by stan.
#' @param obs A list of options as generated by [obs_opts()] defining the
#' observation model. Defaults to [obs_opts()].
#' @param dates A vector of dates used to calculate the day of the week.
#' @seealso [obs_opts()]
#' @return A list of settings ready to be passed to `{stan}` defining
#' @return A list of settings ready to be passed to stan defining
#' the Observation Model
#' @export
#' @author Sam Abbott
Expand Down Expand Up @@ -409,8 +409,8 @@ create_obs_model <- function(obs = obs_opts(), dates) {
#'
#' @description`r lifecycle::badge("stable")`
#' Takes the output of [stan_opts()] and converts it into a list understood by
#' `{stan}`. Internally calls the other `create_` family of functions to
#' construct a single list for input into `{stan}` with all data required
#' stan. Internally calls the other `create_` family of functions to
#' construct a single list for input into stan with all data required
#' present.
#'
#' @param shifted_cases A `<data.frame>` of delay shifted cases
Expand Down Expand Up @@ -500,7 +500,7 @@ create_stan_data <- function(reported_cases, seeding_time,
#' @description `r lifecycle::badge("stable")`
#' Uses the output of [create_stan_data()] to create a function which can be
#' used to sample from the prior distributions (or as close as possible) for
#' parameters. Used in order to initialise each `{stan}` chain within a range of
#' parameters. Used in order to initialise each stan chain within a range of
#' plausible values.
#' @param data A list of data as produced by [create_stan_data()].
#' @return An initial condition generating function
Expand Down Expand Up @@ -608,7 +608,7 @@ create_initial_conditions <- function(data) {
#' to [stan_opts()]. Can be used to override `data`, `init`, and `verbose`
#' settings if desired.
#'
#' @param data A list of `{stan}` data as created by [create_stan_data()]
#' @param data A list of stan data as created by [create_stan_data()]
#'
#' @param init Initial conditions passed to `{rstan}`. Defaults to "random" but
#' can also be a function (as supplied by [create_initial_conditions()]).
Expand All @@ -618,7 +618,7 @@ create_initial_conditions <- function(data) {
#'
#' @importFrom utils modifyList
#'
#' @return A list of `{stan}` arguments
#' @return A list of stan arguments
#' @author Sam Abbott
#' @export
#' @examples
Expand Down
6 changes: 3 additions & 3 deletions R/dist.R
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ dist_skel <- function(n, dist = FALSE, cum = TRUE, model,
#'
#' @description `r lifecycle::badge("stable")`
#' Fits an integer adjusted exponential, gamma or lognormal distribution using
#' `{stan}`.
#' stan.
#' @param values Numeric vector of values
#'
#' @param samples Numeric, number of samples to take. Must be >= 1000.
Expand All @@ -196,7 +196,7 @@ dist_skel <- function(n, dist = FALSE, cum = TRUE, model,
#' @param verbose Logical, defaults to FALSE. Should verbose progress messages
#' be printed.
#'
#' @return A `{stan}` fit of an interval censored distribution
#' @return A stan fit of an interval censored distribution
#' @author Sam Abbott
#' @export
#' @examples
Expand Down Expand Up @@ -614,7 +614,7 @@ estimate_delay <- function(delays, ...) {
#'
#' @description `r lifecycle::badge("soft-deprecated")`
#' Convolves cases by a PMF function. This function will soon be removed or
#' replaced with a more robust `{stan}` implementation.
#' replaced with a more robust stan implementation.
#'
#' @param cases A `<data.frame>` of cases (in date order) with the following
#' variables: `date` and `cases`.
Expand Down
6 changes: 3 additions & 3 deletions R/extract.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Extract Samples for a Parameter from a Stan model
#'
#' @description `r lifecycle::badge("stable")`
#' Extracts a single from a list of `{stan}` output and returns it as a
#' Extracts a single from a list of stan output and returns it as a
#' `<data.table>`.
#
#' @param param Character string indicating the parameter to extract
Expand Down Expand Up @@ -57,10 +57,10 @@ extract_static_parameter <- function(param, samples) {
#' Extract Parameter Samples from a Stan Model
#'
#' @description `r lifecycle::badge("stable")`
#' Extracts a custom set of parameters from a `{stan}` object and adds
#' Extracts a custom set of parameters from a stan object and adds
#' stratification and dates where appropriate.
#'
#' @param stan_fit A fit `{stan}` model as returned by [rstan::sampling()].
#' @param stan_fit A fit stan model as returned by [rstan::sampling()].
#'
#' @param data A list of the data supplied to the [rstan::sampling()] call.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/regional_epinow.R
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ clean_regions <- function(reported_cases, non_zero_points) {
#'
#' @description `r lifecycle::badge("maturing")`
#' Internal function that handles calling [epinow()]. Future work will extend
#' this function to better handle `{stan}` logs and allow the user to modify
#' this function to better handle stan logs and allow the user to modify
#' settings between regions.
#'
#' @param target_region Character string indicating the region being evaluated
Expand Down
6 changes: 3 additions & 3 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ map_prob_change <- function(var) {
#'
#' @description `r lifecycle::badge("questioning")`
#' See [here](https://www.medrxiv.org/content/10.1101/2020.01.30.20019877v3.full.pdf) # nolint
#' for justification. Now handled internally by `{stan}` so may be removed in
#' for justification. Now handled internally by stan so may be removed in
#' future updates if no user demand.
#' @param r Numeric, rate of growth estimates.
#'
Expand Down Expand Up @@ -146,7 +146,7 @@ R_to_growth <- function(R, gamma_mean, gamma_sd) {
#' Allocate Delays into Required Stan Format
#'
#' @description `r lifecycle::badge("stable")`
#' Allocate delays for `{stan}`. Used in [delay_opts()].
#' Allocate delays for stan. Used in [delay_opts()].
#' @param delay_var List of numeric delays
#' @param no_delays Numeric, number of delays
#' @return A numeric array
Expand Down Expand Up @@ -236,7 +236,7 @@ match_output_arguments <- function(input_args = NULL,
#' Expose internal package stan functions in R
#'
#' @description `r lifecycle::badge("stable")`
#' his function exposes internal `{stan}` functions in R from a user
#' his function exposes internal stan functions in R from a user
#' supplied list of target files. Allows for testing of stan functions in R and
#' potentially user use in R code.
#'
Expand Down
2 changes: 1 addition & 1 deletion man/allocate_delays.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/create_backcalc_data.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/create_future_rt.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/create_gp_data.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/create_initial_conditions.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/create_obs_model.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/create_rt_data.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/create_stan_args.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/create_stan_data.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/dist_fit.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/expose_stan_fns.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/extract_parameter.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/extract_parameter_samples.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/growth_to_R.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/run_region.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/sample_approx_dist.Rd

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

0 comments on commit 5921c92

Please sign in to comment.