|
32 | 32 | #' These samples are spaced evenly on the (0, 1) scale, F_X(x) resulting in
|
33 | 33 | #' linear interpolation on the X scale. This is achieved with
|
34 | 34 | #' [stats::quantile()] Type 7 (the default for that function).
|
35 |
| -#' @param symmetrize Logical. If `TRUE`, does two things: (i) forces the |
| 35 | +#' @param symmetrize Scalar logical. If `TRUE`, does two things: (i) forces the |
36 | 36 | #' "empirical" CDF of residuals to be symmetric by pretending that for every
|
37 | 37 | #' actually-observed residual X we also observed another residual -X, and (ii)
|
38 | 38 | #' at each ahead, forces the median simulated value to be equal to the point
|
|
41 | 41 | #' simulating the next ahead. This forces any 1-ahead predictive intervals to
|
42 | 42 | #' be symmetric about the point prediction, and encourages larger aheads to be
|
43 | 43 | #' more symmetric.
|
44 |
| -#' @param nonneg Logical. Force all predictive intervals be non-negative. |
| 44 | +#' @param nonneg Scalar logical. Force all predictive intervals be non-negative. |
45 | 45 | #' Because non-negativity is forced _before_ propagating forward, this has
|
46 | 46 | #' slightly different behaviour than would occur if using [layer_threshold()].
|
47 | 47 | #' Thresholding at each ahead takes place after any shifting from
|
@@ -245,7 +245,8 @@ propagate_samples <- function(
|
245 | 245 | if (symmetrize) {
|
246 | 246 | r <- c(r, -r)
|
247 | 247 | }
|
248 |
| - samp <- quantile(r, probs = c(0, seq_len(nsim - 1)) / (nsim - 1), na.rm = TRUE) |
| 248 | + samp <- quantile(r, probs = c(0, seq_len(nsim - 1)) / (nsim - 1), |
| 249 | + na.rm = TRUE, names = FALSE) |
249 | 250 | res <- list()
|
250 | 251 |
|
251 | 252 | raw <- samp + p
|
|
0 commit comments