Skip to content

Commit

Permalink
Merge branch 'cdc-baseline' of https://github.com/cmu-delphi/epipredict
Browse files Browse the repository at this point in the history
… into cdc-baseline
  • Loading branch information
dajmcdon committed Oct 5, 2023
2 parents b5fe624 + cf9a44e commit bdbd3ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# Created with usethis + edited to use API key.
on:
push:
branches: [main, master]
branches: [main, master, v0.0.6]
pull_request:
branches: [main, master]
branches: [main, master, v0.0.6]

name: R-CMD-check

Expand Down
7 changes: 4 additions & 3 deletions R/layer_cdc_flatline_quantiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' These samples are spaced evenly on the (0, 1) scale, F_X(x) resulting in
#' linear interpolation on the X scale. This is achieved with
#' [stats::quantile()] Type 7 (the default for that function).
#' @param symmetrize Logical. If `TRUE`, does two things: (i) forces the
#' @param symmetrize Scalar logical. If `TRUE`, does two things: (i) forces the
#' "empirical" CDF of residuals to be symmetric by pretending that for every
#' actually-observed residual X we also observed another residual -X, and (ii)
#' at each ahead, forces the median simulated value to be equal to the point
Expand All @@ -41,7 +41,7 @@
#' simulating the next ahead. This forces any 1-ahead predictive intervals to
#' be symmetric about the point prediction, and encourages larger aheads to be
#' more symmetric.
#' @param nonneg Logical. Force all predictive intervals be non-negative.
#' @param nonneg Scalar logical. Force all predictive intervals be non-negative.
#' Because non-negativity is forced _before_ propagating forward, this has
#' slightly different behaviour than would occur if using [layer_threshold()].
#' Thresholding at each ahead takes place after any shifting from
Expand Down Expand Up @@ -245,7 +245,8 @@ propagate_samples <- function(
if (symmetrize) {
r <- c(r, -r)
}
samp <- quantile(r, probs = c(0, seq_len(nsim - 1)) / (nsim - 1), na.rm = TRUE)
samp <- quantile(r, probs = c(0, seq_len(nsim - 1)) / (nsim - 1),
na.rm = TRUE, names = FALSE)
res <- list()

raw <- samp + p
Expand Down
4 changes: 2 additions & 2 deletions man/layer_cdc_flatline_quantiles.Rd

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

0 comments on commit bdbd3ee

Please sign in to comment.