From 6e76e2b379b107f72fd3c88e8b9f1289d02bf4a1 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Mon, 30 Sep 2024 16:12:09 -0700 Subject: [PATCH 01/22] skeleton --- DESCRIPTION | 2 +- NAMESPACE | 24 +-- R/dist_quantiles.R | 259 ++++----------------------- man/dist_quantiles.Rd | 37 ---- tests/testthat/test-dist_quantiles.R | 43 ++--- 5 files changed, 53 insertions(+), 312 deletions(-) delete mode 100644 man/dist_quantiles.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 9c6f6b38a..9746d81da 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -36,7 +36,7 @@ Imports: generics, ggplot2, glue, - hardhat (>= 1.3.0), + hardhat (>= 1.4.0.9002), lifecycle, lubridate, magrittr, diff --git a/NAMESPACE b/NAMESPACE index 076714517..4ce906754 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,8 +2,6 @@ S3method(Add_model,epi_workflow) S3method(Add_model,workflow) -S3method(Math,dist_quantiles) -S3method(Ops,dist_quantiles) S3method(Remove_model,epi_workflow) S3method(Remove_model,workflow) S3method(Update_model,epi_workflow) @@ -48,13 +46,9 @@ S3method(fit,epi_workflow) S3method(flusight_hub_formatter,canned_epipred) S3method(flusight_hub_formatter,data.frame) S3method(forecast,epi_workflow) -S3method(format,dist_quantiles) -S3method(is.na,dist_quantiles) -S3method(is.na,distribution) S3method(key_colnames,epi_workflow) S3method(key_colnames,recipe) -S3method(mean,dist_quantiles) -S3method(median,dist_quantiles) +S3method(mean,quantile_pred) S3method(predict,epi_workflow) S3method(predict,flatline) S3method(prep,check_enough_train_data) @@ -101,7 +95,7 @@ S3method(print,step_lag_difference) S3method(print,step_naomit) S3method(print,step_population_scaling) S3method(print,step_training_window) -S3method(quantile,dist_quantiles) +S3method(quantile,quantile_pred) S3method(refresh_blueprint,default_epi_recipe_blueprint) S3method(residuals,flatline) S3method(run_mold,default_epi_recipe_blueprint) @@ -125,8 +119,6 @@ S3method(tidy,check_enough_train_data) S3method(tidy,frosting) S3method(tidy,layer) S3method(update,layer) -S3method(vec_ptype_abbr,dist_quantiles) -S3method(vec_ptype_full,dist_quantiles) S3method(weighted_interval_score,default) S3method(weighted_interval_score,dist_default) S3method(weighted_interval_score,dist_quantiles) @@ -160,7 +152,6 @@ export(climate_args_list) export(climatological_forecaster) export(default_epi_recipe_blueprint) export(detect_layer) -export(dist_quantiles) export(epi_recipe) export(epi_recipe_blueprint) export(epi_workflow) @@ -230,7 +221,6 @@ export(update_frosting) export(update_model) export(validate_layer) export(weighted_interval_score) -import(distributional) import(epidatasets) import(epiprocess) import(parsnip) @@ -325,14 +315,11 @@ importFrom(rlang,list2) importFrom(rlang,set_names) importFrom(rlang,sym) importFrom(stats,as.formula) -importFrom(stats,family) importFrom(stats,lm) -importFrom(stats,median) importFrom(stats,model.frame) importFrom(stats,na.omit) importFrom(stats,poly) importFrom(stats,predict) -importFrom(stats,qnorm) importFrom(stats,quantile) importFrom(stats,residuals) importFrom(tibble,as_tibble) @@ -346,13 +333,6 @@ importFrom(tidyr,pivot_wider) importFrom(tidyr,unnest) importFrom(tidyselect,all_of) importFrom(utils,capture.output) -importFrom(vctrs,as_list_of) -importFrom(vctrs,field) -importFrom(vctrs,new_rcrd) -importFrom(vctrs,new_vctr) importFrom(vctrs,vec_cast) importFrom(vctrs,vec_data) -importFrom(vctrs,vec_ptype_abbr) -importFrom(vctrs,vec_ptype_full) -importFrom(vctrs,vec_recycle_common) importFrom(workflows,extract_preprocessor) diff --git a/R/dist_quantiles.R b/R/dist_quantiles.R index d40a1d481..db8e62d10 100644 --- a/R/dist_quantiles.R +++ b/R/dist_quantiles.R @@ -1,209 +1,68 @@ -#' @importFrom vctrs field vec_cast new_rcrd -new_quantiles <- function(values = double(1), quantile_levels = double(1)) { - arg_is_probabilities(quantile_levels) - - vec_cast(values, double()) - vec_cast(quantile_levels, double()) - values <- unname(values) - if (length(values) == 0L) { - return(new_rcrd( - list( - values = rep(NA_real_, length(quantile_levels)), - quantile_levels = quantile_levels - ), - class = c("dist_quantiles", "dist_default") - )) - } - stopifnot(length(values) == length(quantile_levels)) - - stopifnot(!vctrs::vec_duplicate_any(quantile_levels)) - if (is.unsorted(quantile_levels)) { - o <- vctrs::vec_order(quantile_levels) - values <- values[o] - quantile_levels <- quantile_levels[o] - } - if (is.unsorted(values, na.rm = TRUE)) { - cli_abort("`values[order(quantile_levels)]` produces unsorted quantiles.") - } - - new_rcrd(list(values = values, quantile_levels = quantile_levels), - class = c("dist_quantiles", "dist_default") - ) -} - - - -#' @importFrom vctrs vec_ptype_abbr vec_ptype_full -#' @export -vec_ptype_abbr.dist_quantiles <- function(x, ...) "dist_qntls" -#' @export -vec_ptype_full.dist_quantiles <- function(x, ...) "dist_quantiles" - -#' @export -format.dist_quantiles <- function(x, digits = 2, ...) { - m <- suppressWarnings(median(x)) - paste0("quantiles(", round(m, digits), ")[", vctrs::vec_size(x), "]") -} - - -#' A distribution parameterized by a set of quantiles -#' -#' @param values A vector (or list of vectors) of values. -#' @param quantile_levels A vector (or list of vectors) of probabilities -#' corresponding to `values`. -#' -#' When creating multiple sets of `values`/`quantile_levels` resulting in -#' different distributions, the sizes must match. See the examples below. -#' -#' @return A vector of class `"distribution"`. -#' -#' @export -#' -#' @examples -#' dist_quantiles(1:4, 1:4 / 5) -#' dist_quantiles(list(1:3, 1:4), list(1:3 / 4, 1:4 / 5)) -#' dstn <- dist_quantiles(list(1:4, 8:11), c(.2, .4, .6, .8)) -#' dstn -#' -#' quantile(dstn, p = c(.1, .25, .5, .9)) -#' median(dstn) -#' -#' # it's a bit annoying to inspect the data -#' distributional::parameters(dstn[1]) -#' nested_quantiles(dstn[1])[[1]] -#' -#' @importFrom vctrs as_list_of vec_recycle_common new_vctr -dist_quantiles <- function(values, quantile_levels) { - if (!is.list(quantile_levels)) { - assert_numeric(quantile_levels, lower = 0, upper = 1, any.missing = FALSE, min.len = 1L) - quantile_levels <- list(quantile_levels) - } - if (!is.list(values)) { - if (length(values) == 0L) values <- NA_real_ - values <- list(values) - } - - values <- as_list_of(values, .ptype = double()) - quantile_levels <- as_list_of(quantile_levels, .ptype = double()) - args <- vec_recycle_common(values = values, quantile_levels = quantile_levels) - - qntls <- as_list_of( - map2(args$values, args$quantile_levels, new_quantiles), - .ptype = new_quantiles(NA_real_, 0.5) - ) - new_vctr(qntls, class = "distribution") -} - -validate_dist_quantiles <- function(values, quantile_levels) { - map(quantile_levels, arg_is_probabilities) - common_length <- vctrs::vec_size_common( # aborts internally - values = values, - quantile_levels = quantile_levels - ) - length_diff <- vctrs::list_sizes(values) != vctrs::list_sizes(quantile_levels) - if (any(length_diff)) { - cli_abort(c( - "`values` and `quantile_levels` must have common length.", - i = "Mismatches found at position(s): {.val {which(length_diff)}}." - )) - } - level_duplication <- map_lgl(quantile_levels, vctrs::vec_duplicate_any) - if (any(level_duplication)) { - cli_abort(c( - "`quantile_levels` must not be duplicated.", - i = "Duplicates found at position(s): {.val {which(level_duplication)}}." - )) - } -} - - -is_dist_quantiles <- function(x) { - is_distribution(x) & all(stats::family(x) == "quantiles") -} - - - -#' @export -#' @importFrom stats median qnorm family -median.dist_quantiles <- function(x, na.rm = FALSE, ..., middle = c("cubic", "linear")) { - quantile_levels <- field(x, "quantile_levels") - values <- field(x, "values") - # we have exactly that quantile - if (0.5 %in% quantile_levels) { - return(values[match(0.5, quantile_levels)]) - } - # if there's only 1 quantile_level (and it isn't 0.5), or the smallest quantile is larger than 0.5 or the largest smaller than 0.5, or if every value is NA, return NA - if (length(quantile_levels) < 2 || min(quantile_levels) > 0.5 || max(quantile_levels) < 0.5 || all(is.na(values))) { - return(NA) - } - if (length(quantile_levels) < 3 || min(quantile_levels) > .25 || max(quantile_levels) < .75) { - return(stats::approx(quantile_levels, values, xout = 0.5)$y) - } - quantile(x, 0.5, ..., middle = middle) -} # placeholder to avoid errors, but not ideal #' @export -mean.dist_quantiles <- function(x, na.rm = FALSE, ..., middle = c("cubic", "linear")) { - median(x, ..., middle = middle) +mean.quantile_pred <- function(x, na.rm = FALSE, ...) { + median(x, ...) } #' @export #' @importFrom stats quantile -#' @import distributional -quantile.dist_quantiles <- function(x, p, ..., middle = c("cubic", "linear")) { +quantile.quantile_pred <- function(x, p, ..., middle = c("cubic", "linear")) { arg_is_probabilities(p) p <- sort(p) - middle <- match.arg(middle) + middle <- rlang::arg_match(middle) quantile_extrapolate(x, p, middle) } quantile_extrapolate <- function(x, tau_out, middle) { - tau <- field(x, "quantile_levels") - qvals <- field(x, "values") - nas <- is.na(qvals) - if (all(nas)) { - return(rep(NA, times = length(tau_out))) - } - qvals_out <- rep(NA, length(tau_out)) - qvals <- qvals[!nas] - tau <- tau[!nas] + tau <- x %@% "quantile_levels" + qvals <- as.matrix(x) # short circuit if we aren't actually extrapolating # matches to ~15 decimals if (all(tau_out %in% tau)) { - return(qvals[match(tau_out, tau)]) + return(hardhat::quantile_pred( + qvals[ ,match(tau_out, tau), drop = FALSE], tau_out + )) } if (length(tau) < 2) { - cli_abort( - "Quantile extrapolation is not possible with fewer than 2 quantiles." - ) - return(qvals_out) + cli_abort(paste( + "Quantile extrapolation is not possible when fewer than 2 quantiles", + "are available." + )) } + qvals_out <- map( + vctrs::vec_chop(qvals), + ~ extrapolate_quantiles_single(.x, tau, tau_out, middle) + ) + hardhat::quantile_pred(qvals_out, tau_out) +} + +extrapolate_quantiles_single <- function(qvals, tau, tau_out, middle) { indl <- tau_out < min(tau) indr <- tau_out > max(tau) indm <- !indl & !indr + qvals_out <- rep(NA, length(tau_out)) if (middle == "cubic") { method <- "cubic" - result <- tryCatch( - { - Q <- stats::splinefun(tau, qvals, method = "hyman") - quartiles <- Q(c(.25, .5, .75)) - }, - error = function(e) { - return(NA) - } - ) + result <- tryCatch({ + Q <- stats::splinefun(tau, qvals, method = "hyman") + quartiles <- Q(c(.25, .5, .75)) + }, + error = function(e) { + return(NA) + }) } if (middle == "linear" || any(is.na(result))) { method <- "linear" quartiles <- stats::approx(tau, qvals, c(.25, .5, .75))$y } if (any(indm)) { - qvals_out[indm] <- switch(method, + qvals_out[indm] <- switch( + method, linear = stats::approx(tau, qvals, tau_out[indm])$y, cubic = Q(tau_out[indm]) ) @@ -242,59 +101,3 @@ tail_extrapolate <- function(tau_out, qv) { m <- diff(y) / diff(x) m * (x0 - x[1]) + y[1] } - - -#' @method Math dist_quantiles -#' @export -Math.dist_quantiles <- function(x, ...) { - quantile_levels <- field(x, "quantile_levels") - values <- field(x, "values") - values <- vctrs::vec_math(.Generic, values, ...) - new_quantiles(values = values, quantile_levels = quantile_levels) -} - -#' @method Ops dist_quantiles -#' @export -Ops.dist_quantiles <- function(e1, e2) { - is_quantiles <- c( - inherits(e1, "dist_quantiles"), - inherits(e2, "dist_quantiles") - ) - is_dist <- c(inherits(e1, "dist_default"), inherits(e2, "dist_default")) - tau1 <- tau2 <- NULL - if (is_quantiles[1]) { - q1 <- field(e1, "values") - tau1 <- field(e1, "quantile_levels") - } - if (is_quantiles[2]) { - q2 <- field(e2, "values") - tau2 <- field(e2, "quantile_levels") - } - tau <- union(tau1, tau2) - if (all(is_dist)) { - cli_abort( - "You can't perform arithmetic between two distributions like this." - ) - } else { - if (is_quantiles[1]) { - q2 <- e2 - } else { - q1 <- e1 - } - } - q <- vctrs::vec_arith(.Generic, q1, q2) - new_quantiles(values = q, quantile_levels = tau) -} - -#' @method is.na distribution -#' @export -is.na.distribution <- function(x) { - sapply(vec_data(x), is.na) -} - -#' @method is.na dist_quantiles -#' @export -is.na.dist_quantiles <- function(x) { - q <- field(x, "values") - all(is.na(q)) -} diff --git a/man/dist_quantiles.Rd b/man/dist_quantiles.Rd deleted file mode 100644 index 1a3226e36..000000000 --- a/man/dist_quantiles.Rd +++ /dev/null @@ -1,37 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dist_quantiles.R -\name{dist_quantiles} -\alias{dist_quantiles} -\title{A distribution parameterized by a set of quantiles} -\usage{ -dist_quantiles(values, quantile_levels) -} -\arguments{ -\item{values}{A vector (or list of vectors) of values.} - -\item{quantile_levels}{A vector (or list of vectors) of probabilities -corresponding to \code{values}. - -When creating multiple sets of \code{values}/\code{quantile_levels} resulting in -different distributions, the sizes must match. See the examples below.} -} -\value{ -A vector of class \code{"distribution"}. -} -\description{ -A distribution parameterized by a set of quantiles -} -\examples{ -dist_quantiles(1:4, 1:4 / 5) -dist_quantiles(list(1:3, 1:4), list(1:3 / 4, 1:4 / 5)) -dstn <- dist_quantiles(list(1:4, 8:11), c(.2, .4, .6, .8)) -dstn - -quantile(dstn, p = c(.1, .25, .5, .9)) -median(dstn) - -# it's a bit annoying to inspect the data -distributional::parameters(dstn[1]) -nested_quantiles(dstn[1])[[1]] - -} diff --git a/tests/testthat/test-dist_quantiles.R b/tests/testthat/test-dist_quantiles.R index 78d74c812..dd078c881 100644 --- a/tests/testthat/test-dist_quantiles.R +++ b/tests/testthat/test-dist_quantiles.R @@ -1,36 +1,31 @@ -suppressPackageStartupMessages(library(distributional)) - -test_that("constructor returns reasonable quantiles", { - expect_snapshot(error = TRUE, new_quantiles(rnorm(5), c(-2, -1, 0, 1, 2))) - expect_silent(new_quantiles(sort(rnorm(5)), sort(runif(5)))) - expect_snapshot(error = TRUE, new_quantiles(sort(rnorm(5)), sort(runif(2)))) - expect_silent(new_quantiles(1:5, 1:5 / 10)) - expect_snapshot(error = TRUE, new_quantiles(c(2, 1, 3, 4, 5), c(.1, .1, .2, .5, .8))) - expect_snapshot(error = TRUE, new_quantiles(c(2, 1, 3, 4, 5), c(.1, .15, .2, .5, .8))) - expect_snapshot(error = TRUE, new_quantiles(c(1, 2, 3), c(.1, .2, 3))) -}) - - -test_that("single dist_quantiles works, quantiles are accessible", { - z <- new_quantiles(values = 1:5, quantile_levels = c(.2, .4, .5, .6, .8)) - expect_s3_class(z, "dist_quantiles") +test_that("single quantile_pred works, quantiles are accessible", { + z <- hardhat::quantile_pred( + values = matrix(1:5, nrow = 1), + quantile_levels = c(.2, .4, .5, .6, .8) + ) expect_equal(median(z), 3) - expect_equal(quantile(z, c(.2, .4, .5, .6, .8)), 1:5) - expect_equal(quantile(z, c(.3, .7), middle = "linear"), c(1.5, 4.5)) + expect_equal( + quantile(z, c(.2, .4, .5, .6, .8)), + hardhat::quantile_pred(matrix(1:5, nrow = 1), c(.2, .4, .5, .6, .8)) + ) + expect_equal( + quantile(z, c(.3, .7), middle = "linear"), + hardhat::quantile_pred(matrix(c(1.5, 4.5), nrow = 1), c(.3, .7)) + ) Q <- stats::splinefun(c(.2, .4, .5, .6, .8), 1:5, method = "hyman") expect_equal(quantile(z, c(.3, .7), middle = "cubic"), Q(c(.3, .7))) expect_identical( extrapolate_quantiles(z, c(.3, .7), middle = "linear"), - new_quantiles(values = c(1, 1.5, 2, 3, 4, 4.5, 5), quantile_levels = 2:8 / 10) + hardhat::quantile_pred(c(1, 1.5, 2, 3, 4, 4.5, 5), 2:8 / 10) ) # empty values slot results in a length zero distribution # see issue #361 - expect_length(dist_quantiles(list(), c(.1, .9)), 0L) - expect_identical( - dist_quantiles(list(), c(.1, .9)), - distributional::dist_degenerate(double()) - ) + # expect_length(dist_quantiles(list(), c(.1, .9)), 0L) + # expect_identical( + # dist_quantiles(list(), c(.1, .9)), + # distributional::dist_degenerate(double()) + # ) }) From 7a87ae62465ed8e78304b6072142eb414ee887c4 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 19 Feb 2025 15:04:05 -0800 Subject: [PATCH 02/22] add math ops and related tests --- NAMESPACE | 12 ++- R/extrapolate_quantiles.R | 40 ++++---- ...st_quantiles.R => quantile_pred-methods.R} | 75 +++++++++++++-- tests/testthat/test-dist_quantiles.R | 96 ++++++++----------- 4 files changed, 131 insertions(+), 92 deletions(-) rename R/{dist_quantiles.R => quantile_pred-methods.R} (52%) diff --git a/NAMESPACE b/NAMESPACE index 4ce906754..3733d5ae2 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -39,9 +39,7 @@ S3method(extract_frosting,default) S3method(extract_frosting,epi_workflow) S3method(extract_layers,frosting) S3method(extract_layers,workflow) -S3method(extrapolate_quantiles,dist_default) -S3method(extrapolate_quantiles,dist_quantiles) -S3method(extrapolate_quantiles,distribution) +S3method(extrapolate_quantiles,quantile_pred) S3method(fit,epi_workflow) S3method(flusight_hub_formatter,canned_epipred) S3method(flusight_hub_formatter,data.frame) @@ -119,6 +117,10 @@ S3method(tidy,check_enough_train_data) S3method(tidy,frosting) S3method(tidy,layer) S3method(update,layer) +S3method(vec_arith,quantile_pred) +S3method(vec_arith.numeric,quantile_pred) +S3method(vec_arith.quantile_pred,numeric) +S3method(vec_math,quantile_pred) S3method(weighted_interval_score,default) S3method(weighted_interval_score,dist_default) S3method(weighted_interval_score,dist_quantiles) @@ -333,6 +335,8 @@ importFrom(tidyr,pivot_wider) importFrom(tidyr,unnest) importFrom(tidyselect,all_of) importFrom(utils,capture.output) +importFrom(vctrs,vec_arith) +importFrom(vctrs,vec_arith.numeric) importFrom(vctrs,vec_cast) -importFrom(vctrs,vec_data) +importFrom(vctrs,vec_math) importFrom(workflows,extract_preprocessor) diff --git a/R/extrapolate_quantiles.R b/R/extrapolate_quantiles.R index 3362e339e..d9e899ef6 100644 --- a/R/extrapolate_quantiles.R +++ b/R/extrapolate_quantiles.R @@ -32,34 +32,28 @@ extrapolate_quantiles <- function(x, probs, replace_na = TRUE, ...) { } #' @export -#' @importFrom vctrs vec_data -extrapolate_quantiles.distribution <- function(x, probs, replace_na = TRUE, ...) { - rlang::check_dots_empty() +extrapolate_quantiles.quantile_pred <- function(x, probs, replace_na = TRUE, ...) { arg_is_lgl_scalar(replace_na) arg_is_probabilities(probs) if (is.unsorted(probs)) probs <- sort(probs) - dstn <- lapply(vec_data(x), extrapolate_quantiles, probs = probs, replace_na = replace_na) - new_vctr(dstn, vars = NULL, class = "distribution") -} - -#' @export -extrapolate_quantiles.dist_default <- function(x, probs, replace_na = TRUE, ...) { - values <- quantile(x, probs, ...) - new_quantiles(values = values, quantile_levels = probs) -} + orig_probs <- x %@% "quantile_levels" + orig_values <- as.matrix(x) -#' @export -extrapolate_quantiles.dist_quantiles <- function(x, probs, replace_na = TRUE, ...) { - orig_probs <- field(x, "quantile_levels") - orig_values <- field(x, "values") - new_probs <- c(orig_probs, probs) - dups <- duplicated(new_probs) if (!replace_na || !anyNA(orig_values)) { - new_values <- c(orig_values, quantile(x, probs, ...)) + all_values <- cbind(orig_values, quantile(x, probs, ...)) } else { - nas <- is.na(orig_values) - orig_values[nas] <- quantile(x, orig_probs[nas], ...) - new_values <- c(orig_values, quantile(x, probs, ...)) + newx <- quantile(x, orig_probs, ...) %>% + hardhat::quantile_pred(orig_probs) + all_values <- cbind(as.matrix(newx), quantile(newx, probs, ...)) } - new_quantiles(new_values[!dups], new_probs[!dups]) + all_probs <- c(orig_probs, probs) + dups <- duplicated(all_probs) + all_values <- all_values[, !dups, drop = FALSE] + all_probs <- all_probs[!dups] + o <- order(all_probs) + + hardhat::quantile_pred( + all_values[, o, drop = FALSE], + quantile_levels = all_probs[o] + ) } diff --git a/R/dist_quantiles.R b/R/quantile_pred-methods.R similarity index 52% rename from R/dist_quantiles.R rename to R/quantile_pred-methods.R index db8e62d10..20379b46e 100644 --- a/R/dist_quantiles.R +++ b/R/quantile_pred-methods.R @@ -5,26 +5,29 @@ mean.quantile_pred <- function(x, na.rm = FALSE, ...) { median(x, ...) } + +# quantiles by treating quantile_pred like a distribution ----------------- + + #' @export #' @importFrom stats quantile -quantile.quantile_pred <- function(x, p, ..., middle = c("cubic", "linear")) { +quantile.quantile_pred <- function(x, p, na.rm = FALSE, ..., + middle = c("cubic", "linear")) { arg_is_probabilities(p) p <- sort(p) middle <- rlang::arg_match(middle) - quantile_extrapolate(x, p, middle) + quantile_internal(x, p, middle) } -quantile_extrapolate <- function(x, tau_out, middle) { +quantile_internal <- function(x, tau_out, middle) { tau <- x %@% "quantile_levels" qvals <- as.matrix(x) # short circuit if we aren't actually extrapolating # matches to ~15 decimals - if (all(tau_out %in% tau)) { - return(hardhat::quantile_pred( - qvals[ ,match(tau_out, tau), drop = FALSE], tau_out - )) + if (all(tau_out %in% tau) && !anyNA(qvals)) { + return(qvals[ , match(tau_out, tau), drop = FALSE]) } if (length(tau) < 2) { cli_abort(paste( @@ -36,15 +39,26 @@ quantile_extrapolate <- function(x, tau_out, middle) { vctrs::vec_chop(qvals), ~ extrapolate_quantiles_single(.x, tau, tau_out, middle) ) - - hardhat::quantile_pred(qvals_out, tau_out) + qvals_out <- do.call(rbind, qvals_out) # ensure a matrix of the proper dims + qvals_out } extrapolate_quantiles_single <- function(qvals, tau, tau_out, middle) { + qvals_out <- rep(NA, length(tau_out)) + good <- !is.na(qvals) + qvals <- qvals[good] + tau <- tau[good] + + # in case we only have one point, and it matches something we wanted + if (length(good) < 2) { + matched_one <- tau_out %in% tau + qvals_out[matched_one] <- qvals[matched_one] + return(qvals_out) + } + indl <- tau_out < min(tau) indr <- tau_out > max(tau) indm <- !indl & !indr - qvals_out <- rep(NA, length(tau_out)) if (middle == "cubic") { method <- "cubic" @@ -101,3 +115,44 @@ tail_extrapolate <- function(tau_out, qv) { m <- diff(y) / diff(x) m * (x0 - x[1]) + y[1] } + + +# mathematical operations on the values ----------------------------------- + + +#' @importFrom vctrs vec_math +#' @export +#' @method vec_math quantile_pred +vec_math.quantile_pred <- function(.fn, .x, ...) { + fn <- .fn + .fn <- getExportedValue("base", .fn) + if (fn %in% c("any", "all", "prod", "sum", "cumsum", "cummax", "cummin", "cumprod")) { + cli_abort("{.fn {fn}} is not a supported operation for {.cls quantile_pred}.") + } + quantile_levels <- .x %@% "quantile_levels" + .x <- as.matrix(.x) + hardhat::quantile_pred(.fn(.x), quantile_levels) +} + +#' @importFrom vctrs vec_arith vec_arith.numeric +#' @export +#' @method vec_arith quantile_pred +vec_arith.quantile_pred <- function(op, x, y, ...) { + UseMethod("vec_arith.quantile_pred", y) +} + +#' @export +#' @method vec_arith.quantile_pred numeric +vec_arith.quantile_pred.numeric <- function(op, x, y, ...) { + op_fn <- getExportedValue("base", op) + out <- op_fn(as.matrix(x), y) + hardhat::quantile_pred(out, x %@% "quantile_levels") +} + +#' @export +#' @method vec_arith.numeric quantile_pred +vec_arith.numeric.quantile_pred <- function(op, x, y, ...) { + op_fn <- getExportedValue("base", op) + out <- op_fn(x, as.matrix(y)) + hardhat::quantile_pred(out, y %@% "quantile_levels") +} diff --git a/tests/testthat/test-dist_quantiles.R b/tests/testthat/test-dist_quantiles.R index dd078c881..170a36438 100644 --- a/tests/testthat/test-dist_quantiles.R +++ b/tests/testthat/test-dist_quantiles.R @@ -4,53 +4,38 @@ test_that("single quantile_pred works, quantiles are accessible", { quantile_levels = c(.2, .4, .5, .6, .8) ) expect_equal(median(z), 3) - expect_equal( - quantile(z, c(.2, .4, .5, .6, .8)), - hardhat::quantile_pred(matrix(1:5, nrow = 1), c(.2, .4, .5, .6, .8)) - ) + expect_equal(quantile(z, c(.2, .4, .5, .6, .8)), matrix(1:5, nrow = 1)) expect_equal( quantile(z, c(.3, .7), middle = "linear"), - hardhat::quantile_pred(matrix(c(1.5, 4.5), nrow = 1), c(.3, .7)) + matrix(c(1.5, 4.5), nrow = 1) ) Q <- stats::splinefun(c(.2, .4, .5, .6, .8), 1:5, method = "hyman") - expect_equal(quantile(z, c(.3, .7), middle = "cubic"), Q(c(.3, .7))) + expect_equal(quantile(z, c(.3, .7)), Q(c(.3, .7))) expect_identical( extrapolate_quantiles(z, c(.3, .7), middle = "linear"), - hardhat::quantile_pred(c(1, 1.5, 2, 3, 4, 4.5, 5), 2:8 / 10) + hardhat::quantile_pred(matrix(c(1, 1.5, 2, 3, 4, 4.5, 5), nrow = 1), 2:8 / 10) ) - # empty values slot results in a length zero distribution - # see issue #361 - # expect_length(dist_quantiles(list(), c(.1, .9)), 0L) - # expect_identical( - # dist_quantiles(list(), c(.1, .9)), - # distributional::dist_degenerate(double()) - # ) }) test_that("quantile extrapolator works", { - dstn <- dist_normal(c(10, 2), c(5, 10)) - qq <- extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75)) - expect_s3_class(qq, "distribution") - expect_s3_class(vctrs::vec_data(qq[1])[[1]], "dist_quantiles") - expect_length(parameters(qq[1])$quantile_levels[[1]], 3L) - - - dstn <- dist_quantiles(list(1:4, 8:11), list(c(.2, .4, .6, .8))) + dstn <- hardhat::quantile_pred( + matrix(c(1:4, 8:11), nrow = 2, byrow = TRUE), + c(.2, .4, .6, .8) + ) qq <- extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75)) - expect_s3_class(qq, "distribution") - expect_s3_class(vctrs::vec_data(qq[1])[[1]], "dist_quantiles") - expect_length(parameters(qq[1])$quantile_levels[[1]], 7L) + expect_s3_class(qq, c("quantile_pred", "vctrs_vctr", "list")) + expect_length(qq %@% "quantile_levels", 7L) - dstn <- dist_quantiles(1:4, 1:4 / 5) + dstn <- hardhat::quantile_pred(matrix(1:4, nrow = 1), 1:4 / 5) qq <- extrapolate_quantiles(dstn, 1:9 / 10) - dstn_na <- dist_quantiles(c(1, 2, NA, 4), 1:4 / 5) + dstn_na <- hardhat::quantile_pred(matrix(c(1, 2, NA, 4), nrow = 1), 1:4 / 5) qq2 <- extrapolate_quantiles(dstn_na, 1:9 / 10) expect_equal(qq, qq2) qq3 <- extrapolate_quantiles(dstn_na, 1:9 / 10, replace_na = FALSE) - qq2_vals <- field(vec_data(qq2)[[1]], "values") - qq3_vals <- field(vec_data(qq3)[[1]], "values") + qq2_vals <- unlist(qq2) + qq3_vals <- unlist(qq3) qq2_vals[6] <- NA expect_equal(qq2_vals, qq3_vals) }) @@ -60,7 +45,7 @@ test_that("small deviations of quantile requests work", { v <- c(0.0890306, 0.1424997, 0.1971793, 0.2850978, 0.3832912, 0.4240479) badl <- l badl[1] <- badl[1] - 1e-14 - distn <- dist_quantiles(list(v), list(l)) + distn <- hardhat::quantile_pred(matrix(v, nrow = 1), l) # was broken before, now works expect_equal(quantile(distn, l), quantile(distn, badl)) @@ -69,50 +54,51 @@ test_that("small deviations of quantile requests work", { # the smallest (largest) values or we could end up unsorted l <- 1:9 / 10 v <- 1:9 - distn <- dist_quantiles(list(v), list(l)) - expect_equal(quantile(distn, c(.25, .75)), list(c(2.5, 7.5))) - expect_equal(quantile(distn, c(.1, .9)), list(c(1, 9))) + distn <- hardhat::quantile_pred(matrix(v, nrow = 1), l) + expect_equal(quantile(distn, c(.25, .75)), matrix(c(2.5, 7.5), nrow = 1)) + expect_equal(quantile(distn, c(.1, .9)), matrix(c(1, 9), nrow = 1)) qv <- data.frame(q = l, v = v) expect_equal( - unlist(quantile(distn, c(.01, .05))), + drop(quantile(distn, c(.01, .05))), tail_extrapolate(c(.01, .05), head(qv, 2)) ) expect_equal( - unlist(quantile(distn, c(.99, .95))), + drop(quantile(distn, c(.99, .95))), tail_extrapolate(c(.95, .99), tail(qv, 2)) ) }) test_that("unary math works on quantiles", { - dstn <- dist_quantiles(list(1:4, 8:11), list(c(.2, .4, .6, .8))) - dstn2 <- dist_quantiles(list(log(1:4), log(8:11)), list(c(.2, .4, .6, .8))) + dstn <- hardhat::quantile_pred( + matrix(c(1:4, 8:11), nrow = 2, byrow = TRUE), + 1:4 / 5 + ) + dstn2 <- hardhat::quantile_pred( + log(matrix(c(1:4, 8:11), nrow = 2, byrow = TRUE)), + 1:4 / 5 + ) expect_identical(log(dstn), dstn2) - dstn2 <- dist_quantiles(list(cumsum(1:4), cumsum(8:11)), list(c(.2, .4, .6, .8))) - expect_identical(cumsum(dstn), dstn2) }) test_that("arithmetic works on quantiles", { - dstn <- dist_quantiles(list(1:4, 8:11), list(c(.2, .4, .6, .8))) - dstn2 <- dist_quantiles(list(1:4 + 1, 8:11 + 1), list(c(.2, .4, .6, .8))) + dstn <- hardhat::quantile_pred( + matrix(c(1:4, 8:11), nrow = 2, byrow = TRUE), + 1:4 / 5 + ) + dstn2 <- hardhat::quantile_pred( + matrix(c(1:4, 8:11), nrow = 2, byrow = TRUE) + 1, + 1:4 / 5 + ) expect_identical(dstn + 1, dstn2) expect_identical(1 + dstn, dstn2) - dstn2 <- dist_quantiles(list(1:4 / 4, 8:11 / 4), list(c(.2, .4, .6, .8))) + dstn2 <- hardhat::quantile_pred( + matrix(c(1:4, 8:11), nrow = 2, byrow = TRUE) / 4, + 1:4 / 5 + ) expect_identical(dstn / 4, dstn2) expect_identical((1 / 4) * dstn, dstn2) - expect_snapshot(error = TRUE, sum(dstn)) - expect_snapshot(error = TRUE, suppressWarnings(dstn + distributional::dist_normal())) -}) - -test_that("quantile.dist_quantile works for NA vectors", { - distn <- dist_quantiles( - list(c(NA, NA)), - list(1:2 / 3) - ) - expect_true(is.na(quantile(distn, p = 0.5))) - expect_true(is.na(median(distn))) - expect_true(is.na(mean(distn))) - expect_equal(format(distn), "quantiles(NA)[2]") + expect_error(sum(dstn)) }) From dcca30138bb86de81326592e88878ca0a930b7e2 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 19 Feb 2025 15:06:11 -0800 Subject: [PATCH 03/22] rename tests --- .../testthat/{test-dist_quantiles.R => test-quantile_pred.R} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename tests/testthat/{test-dist_quantiles.R => test-quantile_pred.R} (96%) diff --git a/tests/testthat/test-dist_quantiles.R b/tests/testthat/test-quantile_pred.R similarity index 96% rename from tests/testthat/test-dist_quantiles.R rename to tests/testthat/test-quantile_pred.R index 170a36438..90710c6e1 100644 --- a/tests/testthat/test-dist_quantiles.R +++ b/tests/testthat/test-quantile_pred.R @@ -11,7 +11,7 @@ test_that("single quantile_pred works, quantiles are accessible", { ) Q <- stats::splinefun(c(.2, .4, .5, .6, .8), 1:5, method = "hyman") - expect_equal(quantile(z, c(.3, .7)), Q(c(.3, .7))) + expect_equal(quantile(z, c(.3, .7)), matrix(Q(c(.3, .7)), nrow = 1)) expect_identical( extrapolate_quantiles(z, c(.3, .7), middle = "linear"), hardhat::quantile_pred(matrix(c(1, 1.5, 2, 3, 4, 4.5, 5), nrow = 1), 2:8 / 10) @@ -100,5 +100,5 @@ test_that("arithmetic works on quantiles", { expect_identical(dstn / 4, dstn2) expect_identical((1 / 4) * dstn, dstn2) - expect_error(sum(dstn)) + expect_snapshot(error = TRUE, sum(dstn)) }) From 316065b8cfe52a64f2822bc8b2d98e745abc8351 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 19 Feb 2025 15:06:59 -0800 Subject: [PATCH 04/22] quantile pred tests pass --- tests/testthat/_snaps/quantile_pred.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/testthat/_snaps/quantile_pred.md diff --git a/tests/testthat/_snaps/quantile_pred.md b/tests/testthat/_snaps/quantile_pred.md new file mode 100644 index 000000000..dd13dcb86 --- /dev/null +++ b/tests/testthat/_snaps/quantile_pred.md @@ -0,0 +1,8 @@ +# arithmetic works on quantiles + + Code + sum(dstn) + Condition + Error in `vec_math()`: + ! `sum()` is not a supported operation for . + From d508069c0191a699066a01dd8ace427628faabfb Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 19 Feb 2025 15:08:46 -0800 Subject: [PATCH 05/22] updates to WIS --- NAMESPACE | 5 +- R/weighted_interval_score.R | 100 +++++++++++---------------------- man/weighted_interval_score.Rd | 19 ++----- 3 files changed, 38 insertions(+), 86 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 3733d5ae2..90dcc43c4 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -121,10 +121,7 @@ S3method(vec_arith,quantile_pred) S3method(vec_arith.numeric,quantile_pred) S3method(vec_arith.quantile_pred,numeric) S3method(vec_math,quantile_pred) -S3method(weighted_interval_score,default) -S3method(weighted_interval_score,dist_default) -S3method(weighted_interval_score,dist_quantiles) -S3method(weighted_interval_score,distribution) +S3method(weighted_interval_score,quantile_pred) export("%>%") export(Add_model) export(Remove_model) diff --git a/R/weighted_interval_score.R b/R/weighted_interval_score.R index 48741de7d..567ae4e69 100644 --- a/R/weighted_interval_score.R +++ b/R/weighted_interval_score.R @@ -13,6 +13,16 @@ #' @param actual double. Actual value(s) #' @param quantile_levels probabilities. If specified, the score will be #' computed at this set of levels. +#' @param na_handling character. Determines how `quantile_levels` without a +#' corresponding `value` are handled. For `"impute"`, missing values will be +#' calculated if possible using the available quantiles. For `"drop"`, +#' explicitly missing values are ignored in the calculation of the score, but +#' implicitly missing values are imputed if possible. +#' For `"propogate"`, the resulting score will be `NA` if any missing values +#' exist in the original `quantile_levels`. Finally, if +#' `quantile_levels` is specified, `"fail"` will result in +#' the score being `NA` when any required quantile levels (implicit or explicit) +#' are do not have corresponding values. #' @param ... not used #' #' @return a vector of nonnegative scores. @@ -44,13 +54,13 @@ #' #' # Using some actual forecasts -------- #' library(dplyr) -#' jhu <- covid_case_death_rates %>% +#' jhu <- case_death_rate_subset %>% #' filter(time_value >= "2021-10-01", time_value <= "2021-12-01") #' preds <- flatline_forecaster( #' jhu, "death_rate", #' flatline_args_list(quantile_levels = c(.01, .025, 1:19 / 20, .975, .99)) #' )$predictions -#' actuals <- covid_case_death_rates %>% +#' actuals <- case_death_rate_subset %>% #' filter(time_value == as.Date("2021-12-01") + 7) %>% #' select(geo_value, time_value, actual = death_rate) #' preds <- left_join(preds, actuals, @@ -58,90 +68,44 @@ #' ) %>% #' mutate(wis = weighted_interval_score(.pred_distn, actual)) #' preds -weighted_interval_score <- function(x, actual, quantile_levels = NULL, ...) { +weighted_interval_score <- function( + x, + actual, + quantile_levels = NULL, + na_handling = c("impute", "drop", "propagate", "fail"), + ...) { UseMethod("weighted_interval_score") } -#' @export -weighted_interval_score.default <- function(x, actual, - quantile_levels = NULL, ...) { - cli_abort(c( - "Weighted interval score can only be calculated if `x`", - "has class {.cls distribution}." - )) -} - -#' @export -weighted_interval_score.distribution <- function( - x, actual, - quantile_levels = NULL, ...) { - assert_numeric(actual, finite = TRUE) - l <- vctrs::vec_recycle_common(x = x, actual = actual) - map2_dbl( - .x = vctrs::vec_data(l$x), - .y = l$actual, - .f = weighted_interval_score, - quantile_levels = quantile_levels, - ... - ) -} - -#' @export -weighted_interval_score.dist_default <- function(x, actual, - quantile_levels = NULL, ...) { - rlang::check_dots_empty() - if (is.null(quantile_levels)) { - cli_warn(c( - "Weighted interval score isn't implemented for {.cls {class(x)}}", - "as we don't know what set of quantile levels to use.", - "Use a {.cls dist_quantiles} or pass `quantile_levels`.", - "The result for this element will be `NA`." - )) - return(NA) - } - x <- extrapolate_quantiles(x, probs = quantile_levels) - weighted_interval_score(x, actual, quantile_levels = NULL) -} -#' @param na_handling character. Determines how `quantile_levels` without a -#' corresponding `value` are handled. For `"impute"`, missing values will be -#' calculated if possible using the available quantiles. For `"drop"`, -#' explicitly missing values are ignored in the calculation of the score, but -#' implicitly missing values are imputed if possible. -#' For `"propogate"`, the resulting score will be `NA` if any missing values -#' exist in the original `quantile_levels`. Finally, if -#' `quantile_levels` is specified, `"fail"` will result in -#' the score being `NA` when any required quantile levels (implicit or explicit) -#' are do not have corresponding values. -#' @describeIn weighted_interval_score Weighted interval score with -#' `dist_quantiles` allows for different `NA` behaviours. #' @export -weighted_interval_score.dist_quantiles <- function( +weighted_interval_score.quantile_pred <- function( x, actual, quantile_levels = NULL, na_handling = c("impute", "drop", "propagate", "fail"), ...) { rlang::check_dots_empty() - if (is.na(actual)) { - return(NA) - } - if (all(is.na(vctrs::field(x, "values")))) { - return(NA) - } + n <- vctrs::vec_size(x) + if (length(actual) == 1L) actual <- rep(actual, n) + assert_numeric(actual, finite = TRUE, len = n) + assert_numeric(quantile_levels, lower = 0, upper = 1, null.ok = TRUE) na_handling <- rlang::arg_match(na_handling) - old_quantile_levels <- field(x, "quantile_levels") + old_quantile_levels <- x %@% "quantile_levels" if (na_handling == "fail") { if (is.null(quantile_levels)) { cli_abort('`na_handling = "fail"` requires `quantile_levels` to be specified.') } - old_values <- field(x, "values") - if (!all(quantile_levels %in% old_quantile_levels) || any(is.na(old_values))) { - return(NA) + if (!all(quantile_levels %in% old_quantile_levels)) { + return(rep(NA_real_, n)) } } tau <- quantile_levels %||% old_quantile_levels - x <- extrapolate_quantiles(x, probs = tau, replace_na = (na_handling == "impute")) - q <- field(x, "values")[field(x, "quantile_levels") %in% tau] + x <- extrapolate_quantiles(x, tau, replace_na = (na_handling == "impute")) + x <- as.matrix(x)[, attr(x, "quantile_levels") %in% tau] na_rm <- (na_handling == "drop") + map2_dbl(vctrs::vec_chop(x), actual, ~ wis_one_quantile(.x, tau, .y, na_rm)) +} + +wis_one_quantile <- function(q, tau, actual, na_rm) { 2 * mean(pmax(tau * (actual - q), (1 - tau) * (q - actual)), na.rm = na_rm) } diff --git a/man/weighted_interval_score.Rd b/man/weighted_interval_score.Rd index 4aac20e7d..4b7c796ea 100644 --- a/man/weighted_interval_score.Rd +++ b/man/weighted_interval_score.Rd @@ -2,12 +2,9 @@ % Please edit documentation in R/weighted_interval_score.R \name{weighted_interval_score} \alias{weighted_interval_score} -\alias{weighted_interval_score.dist_quantiles} \title{Compute weighted interval score} \usage{ -weighted_interval_score(x, actual, quantile_levels = NULL, ...) - -\method{weighted_interval_score}{dist_quantiles}( +weighted_interval_score( x, actual, quantile_levels = NULL, @@ -25,8 +22,6 @@ contains \code{dist_quantiles()}, though other distributions are supported when \item{quantile_levels}{probabilities. If specified, the score will be computed at this set of levels.} -\item{...}{not used} - \item{na_handling}{character. Determines how \code{quantile_levels} without a corresponding \code{value} are handled. For \code{"impute"}, missing values will be calculated if possible using the available quantiles. For \code{"drop"}, @@ -37,6 +32,8 @@ exist in the original \code{quantile_levels}. Finally, if \code{quantile_levels} is specified, \code{"fail"} will result in the score being \code{NA} when any required quantile levels (implicit or explicit) are do not have corresponding values.} + +\item{...}{not used} } \value{ a vector of nonnegative scores. @@ -48,12 +45,6 @@ approximation of the commonly-used continuous ranked probability score generalization of absolute error. For example, see \href{https://arxiv.org/abs/2005.12881}{Bracher et al. (2020)} for discussion in the context of COVID-19 forecasting. } -\section{Methods (by class)}{ -\itemize{ -\item \code{weighted_interval_score(dist_quantiles)}: Weighted interval score with -\code{dist_quantiles} allows for different \code{NA} behaviours. - -}} \examples{ quantile_levels <- c(.2, .4, .6, .8) predq_1 <- 1:4 # @@ -80,13 +71,13 @@ weighted_interval_score(dist_quantiles(1:4, 1:4 / 5), 2.5, 1:9 / 10, # Using some actual forecasts -------- library(dplyr) -jhu <- covid_case_death_rates \%>\% +jhu <- case_death_rate_subset \%>\% filter(time_value >= "2021-10-01", time_value <= "2021-12-01") preds <- flatline_forecaster( jhu, "death_rate", flatline_args_list(quantile_levels = c(.01, .025, 1:19 / 20, .975, .99)) )$predictions -actuals <- covid_case_death_rates \%>\% +actuals <- case_death_rate_subset \%>\% filter(time_value == as.Date("2021-12-01") + 7) \%>\% select(geo_value, time_value, actual = death_rate) preds <- left_join(preds, actuals, From 7278c69053317202b7ddbab1ab071f16a7961375 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 19 Feb 2025 15:55:16 -0800 Subject: [PATCH 06/22] remove the distributional package --- DESCRIPTION | 2 +- NAMESPACE | 8 +- R/autoplot.R | 2 +- R/extrapolate_quantiles.R | 32 ++-- R/flusight_hub_formatter.R | 7 +- R/layer_cdc_flatline_quantiles.R | 7 +- R/layer_predictive_distn.R | 6 + R/layer_quantile_distn.R | 20 ++- R/layer_residual_quantiles.R | 15 +- R/layer_threshold_preds.R | 25 +-- R/make_grf_quantiles.R | 4 +- R/make_quantile_reg.R | 20 +-- R/make_smooth_quantile_reg.R | 4 +- R/pivot_quantiles.R | 156 +++++------------- R/quantile_pred-methods.R | 14 +- R/weighted_interval_score.R | 34 ++-- man/extrapolate_quantiles.Rd | 32 ++-- man/layer_cdc_flatline_quantiles.Rd | 2 +- man/nested_quantiles.Rd | 24 --- man/pivot_quantiles_longer.Rd | 26 +-- man/pivot_quantiles_wider.Rd | 20 +-- man/smooth_quantile_reg.Rd | 2 +- man/weighted_interval_score.Rd | 32 ++-- tests/testthat/_snaps/pivot_quantiles.md | 33 ++-- tests/testthat/_snaps/wis-quantile_pred.md | 16 ++ .../testthat/test-layer_residual_quantiles.R | 6 +- tests/testthat/test-layer_threshold_preds.R | 9 +- tests/testthat/test-pivot_quantiles.R | 72 +++----- ...t-quantiles.R => test-wis-quantile_pred.R} | 27 ++- 29 files changed, 244 insertions(+), 413 deletions(-) delete mode 100644 man/nested_quantiles.Rd create mode 100644 tests/testthat/_snaps/wis-quantile_pred.md rename tests/testthat/{test-wis-dist-quantiles.R => test-wis-quantile_pred.R} (65%) diff --git a/DESCRIPTION b/DESCRIPTION index 9746d81da..01e07520d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,7 +30,6 @@ Depends: Imports: checkmate, cli, - distributional, dplyr, epiprocess (>= 0.10.4), generics, @@ -51,6 +50,7 @@ Imports: workflows (>= 1.0.0) Suggests: data.table, + distributional, epidatr (>= 1.0.0), fs, grf, diff --git a/NAMESPACE b/NAMESPACE index 90dcc43c4..204175a04 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -110,9 +110,7 @@ S3method(slather,layer_residual_quantiles) S3method(slather,layer_threshold) S3method(slather,layer_unnest) S3method(snap,default) -S3method(snap,dist_default) -S3method(snap,dist_quantiles) -S3method(snap,distribution) +S3method(snap,quantile_pred) S3method(tidy,check_enough_train_data) S3method(tidy,frosting) S3method(tidy,layer) @@ -184,8 +182,6 @@ export(layer_quantile_distn) export(layer_residual_quantiles) export(layer_threshold) export(layer_unnest) -export(mutate) -export(nested_quantiles) export(new_default_epi_recipe_blueprint) export(new_epi_recipe_blueprint) export(pivot_longer) @@ -202,6 +198,7 @@ export(rename) export(select) export(slather) export(smooth_quantile_reg) +export(snap) export(step_adjust_latency) export(step_climate) export(step_epi_ahead) @@ -280,6 +277,7 @@ importFrom(ggplot2,geom_point) importFrom(ggplot2,geom_ribbon) importFrom(glue,glue) importFrom(hardhat,extract_recipe) +importFrom(hardhat,quantile_pred) importFrom(hardhat,refresh_blueprint) importFrom(hardhat,run_mold) importFrom(lubridate,"%m-%") diff --git a/R/autoplot.R b/R/autoplot.R index 60b395a7d..4e52ac3e3 100644 --- a/R/autoplot.R +++ b/R/autoplot.R @@ -243,7 +243,7 @@ plot_bands <- function( ntarget_dates <- dplyr::n_distinct(predictions$time_value) predictions <- predictions %>% - mutate(.pred_distn = dist_quantiles(quantile(.pred_distn, levels), levels)) %>% + mutate(.pred_distn = quantile_pred(quantile(.pred_distn, levels), levels)) %>% pivot_quantiles_wider(.pred_distn) qnames <- setdiff(names(predictions), innames) diff --git a/R/extrapolate_quantiles.R b/R/extrapolate_quantiles.R index d9e899ef6..82116c1d3 100644 --- a/R/extrapolate_quantiles.R +++ b/R/extrapolate_quantiles.R @@ -1,32 +1,26 @@ #' Summarize a distribution with a set of quantiles #' -#' @param x a `distribution` vector +#' This function takes a `quantile_pred` vector and returns the same +#' type of object, expanded to include +#' *additional* quantiles computed at `probs`. If you want behaviour more +#' similar to [stats::quantile()], then `quantile(x,...)` may be more +#' appropriate. +#' +#' @param x A vector of class `quantile_pred`. #' @param probs a vector of probabilities at which to calculate quantiles #' @param replace_na logical. If `x` contains `NA`'s, these are imputed if -#' possible (if `TRUE`) or retained (if `FALSE`). This only effects -#' elements of class `dist_quantiles`. +#' possible (if `TRUE`) or retained (if `FALSE`). #' @param ... additional arguments passed on to the `quantile` method #' -#' @return a `distribution` vector containing `dist_quantiles`. Any elements -#' of `x` which were originally `dist_quantiles` will now have a superset +#' @return a `quantile_pred` vector. Each element +#' of `x` will now have a superset #' of the original `quantile_values` (the union of those and `probs`). #' @export #' #' @examples -#' library(distributional) -#' dstn <- dist_normal(c(10, 2), c(5, 10)) -#' extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75)) -#' -#' dstn <- dist_quantiles(list(1:4, 8:11), list(c(.2, .4, .6, .8))) -#' # because this distribution is already quantiles, any extra quantiles are -#' # appended -#' extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75)) -#' -#' dstn <- c( -#' dist_normal(c(10, 2), c(5, 10)), -#' dist_quantiles(list(1:4, 8:11), list(c(.2, .4, .6, .8))) -#' ) -#' extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75)) +#' dstn <- quantile_dstn(rbind(1:4, 8:11), c(.2, .4, .6, .8)) +#' # extra quantiles are appended +#' as.tibble(extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75))) extrapolate_quantiles <- function(x, probs, replace_na = TRUE, ...) { UseMethod("extrapolate_quantiles") } diff --git a/R/flusight_hub_formatter.R b/R/flusight_hub_formatter.R index feac624be..3deba254e 100644 --- a/R/flusight_hub_formatter.R +++ b/R/flusight_hub_formatter.R @@ -104,12 +104,11 @@ flusight_hub_formatter.data.frame <- function( object <- object %>% # combine the predictions and the distribution - mutate(.pred_distn = nested_quantiles(.pred_distn)) %>% - tidyr::unnest(.pred_distn) %>% + pivot_quantiles_longer(.pred_distn) %>% # now we create the correct column names rename( - value = values, - output_type_id = quantile_levels, + value = .pred_distn_value, + output_type_id = .pred_distn_quantile_level, reference_date = forecast_date ) %>% # convert to fips codes, and add any constant cols passed in ... diff --git a/R/layer_cdc_flatline_quantiles.R b/R/layer_cdc_flatline_quantiles.R index 5211170ad..9c08ef768 100644 --- a/R/layer_cdc_flatline_quantiles.R +++ b/R/layer_cdc_flatline_quantiles.R @@ -51,7 +51,7 @@ #' in an additional `` named `.pred_distn_all` containing 2-column #' [tibble::tibble()]'s. For each #' desired combination of `key`'s, the tibble will contain one row per ahead -#' with the associated [dist_quantiles()]. +#' with the associated [quantile_pred()]. #' @export #' #' @examples @@ -265,11 +265,10 @@ propagate_samples <- function( } } res <- res[aheads] + res_quantiles <- map(res, quantile, probs = quantile_levels) list(tibble( ahead = aheads, - .pred_distn = map_vec( - res, ~ dist_quantiles(quantile(.x, quantile_levels), quantile_levels) - ) + .pred_distn = quantile_pred(do.call(rbind, res_quantiles), quantile_levels) )) } diff --git a/R/layer_predictive_distn.R b/R/layer_predictive_distn.R index 2b18fbf8e..8ce55e1c3 100644 --- a/R/layer_predictive_distn.R +++ b/R/layer_predictive_distn.R @@ -45,6 +45,12 @@ layer_predictive_distn <- function(frosting, truncate = c(-Inf, Inf), name = ".pred_distn", id = rand_id("predictive_distn")) { + if (!requireNamespace("distributional", quietly = TRUE)) { + cli_abort(paste( + "You must install the {.pkg distributional} package for", + "this functionality." + )) + } rlang::check_dots_empty() arg_is_chr_scalar(name, id) dist_type <- match.arg(dist_type) diff --git a/R/layer_quantile_distn.R b/R/layer_quantile_distn.R index 2d991a20f..67fbfa28c 100644 --- a/R/layer_quantile_distn.R +++ b/R/layer_quantile_distn.R @@ -78,15 +78,23 @@ layer_quantile_distn_new <- function(quantile_levels, truncate, name, id) { slather.layer_quantile_distn <- function(object, components, workflow, new_data, ...) { dstn <- components$predictions$.pred - if (!inherits(dstn, "distribution")) { - cli_abort(c( - "`layer_quantile_distn()` requires distributional predictions.", - "These are of class {.cls {class(dstn)}}." - )) + is_supported <- inherits(dstn, "distribution") || + inherits(dstn, "quantile_pred") + if (!is_supported) { + cli_abort( + "`layer_quantile_distn()` requires distributional or quantile + predictions. These are of class {.cls {class(dstn)}}." + ) + } + if (inherits(dstn, "distribution") && !requireNamespace("distributional", quietly = TRUE)) { + cli_abort( + "You must install the {.pkg distributional} package for this + functionality." + ) } rlang::check_dots_empty() - dstn <- dist_quantiles( + dstn <- quantile_pred( quantile(dstn, object$quantile_levels), object$quantile_levels ) diff --git a/R/layer_residual_quantiles.R b/R/layer_residual_quantiles.R index 9a811e531..0517a0ffd 100644 --- a/R/layer_residual_quantiles.R +++ b/R/layer_residual_quantiles.R @@ -125,14 +125,11 @@ slather.layer_residual_quantiles <- } r <- r %>% - summarise( - dstn = list(quantile( - c(.resid, s * .resid), - probs = object$quantile_levels, na.rm = TRUE - )) - ) + summarize(dstn = quantile_pred(matrix(quantile( + c(.resid, s * .resid), probs = object$quantile_levels, na.rm = TRUE + ), nrow = 1), quantile_levels = object$quantile_levels)) # Check for NA - if (any(sapply(r$dstn, is.na))) { + if (anyNA(as.matrix(r$dstn))) { cli_abort(c( "Residual quantiles could not be calculated due to missing residuals.", i = "This may be due to `n_train` < `ahead` in your {.cls epi_recipe}." @@ -140,9 +137,7 @@ slather.layer_residual_quantiles <- } estimate <- components$predictions$.pred - res <- tibble( - .pred_distn = dist_quantiles(map2(estimate, r$dstn, "+"), object$quantile_levels) - ) + res <- tibble(.pred_distn = r$dstn + estimate) res <- check_pname(res, components$predictions, object) components$predictions <- mutate(components$predictions, !!!res) components diff --git a/R/layer_threshold_preds.R b/R/layer_threshold_preds.R index d480019a9..c0903ffda 100644 --- a/R/layer_threshold_preds.R +++ b/R/layer_threshold_preds.R @@ -62,6 +62,7 @@ layer_threshold_new <- # restrict various objects to the interval [lower, upper] +#' @export snap <- function(x, lower, upper, ...) { UseMethod("snap") } @@ -74,25 +75,11 @@ snap.default <- function(x, lower, upper, ...) { } #' @export -snap.distribution <- function(x, lower, upper, ...) { - rlang::check_dots_empty() - arg_is_scalar(lower, upper) - dstn <- lapply(vec_data(x), snap, lower = lower, upper = upper) - distributional:::wrap_dist(dstn) -} - -#' @export -snap.dist_default <- function(x, lower, upper, ...) { - rlang::check_dots_empty() - x -} - -#' @export -snap.dist_quantiles <- function(x, lower, upper, ...) { - values <- field(x, "values") - quantile_levels <- field(x, "quantile_levels") - values <- snap(values, lower, upper) - new_quantiles(values = values, quantile_levels = quantile_levels) +snap.quantile_pred <- function(x, lower, upper, ...) { + values <- as.matrix(x) + quantile_levels <- x %@% "quantile_levels" + values <- map(vctrs::vec_chop(values), ~ snap(.x, lower, upper)) + quantile_pred(do.call(rbind, values), quantile_levels = quantile_levels) } #' @export diff --git a/R/make_grf_quantiles.R b/R/make_grf_quantiles.R index b1792adfd..78c855831 100644 --- a/R/make_grf_quantiles.R +++ b/R/make_grf_quantiles.R @@ -162,12 +162,12 @@ make_grf_quantiles <- function() { ) ) - # turn the predictions into a tibble with a dist_quantiles column + # turn the predictions into a tibble with a quantile_pred column process_qrf_preds <- function(x, object) { quantile_levels <- parsnip::extract_fit_engine(object)$quantiles.orig %>% sort() x <- x$predictions out <- lapply(vctrs::vec_chop(x), function(x) sort(drop(x))) - out <- dist_quantiles(out, list(quantile_levels)) + out <- hardhat::quantile_pred(do.call(rbind, out), quantile_levels) return(dplyr::tibble(.pred = out)) } diff --git a/R/make_quantile_reg.R b/R/make_quantile_reg.R index 223881c85..bc2d322bf 100644 --- a/R/make_quantile_reg.R +++ b/R/make_quantile_reg.R @@ -110,21 +110,11 @@ make_quantile_reg <- function() { process_rq_preds <- function(x, object) { object <- parsnip::extract_fit_engine(object) - type <- class(object)[1] - - # can't make a method because object is second - out <- switch(type, - rq = dist_quantiles(unname(as.list(x)), object$tau), # one quantile - rqs = { - x <- lapply(vctrs::vec_chop(x), function(x) sort(drop(x))) - dist_quantiles(x, list(object$tau)) - }, - cli_abort(c( - "Prediction is not implemented for this `rq` type.", - i = "See {.fun quantreg::rq}." - )) - ) - return(dplyr::tibble(.pred = out)) + if (!is.matrix(x)) x <- as.matrix(x) + rownames(x) <- NULL + n_pred_quantiles <- ncol(x) + quantile_levels <- object$tau + tibble(.pred = hardhat::quantile_pred(x, quantile_levels)) } parsnip::set_pred( diff --git a/R/make_smooth_quantile_reg.R b/R/make_smooth_quantile_reg.R index b56a67b37..1ca019f75 100644 --- a/R/make_smooth_quantile_reg.R +++ b/R/make_smooth_quantile_reg.R @@ -47,7 +47,7 @@ #' x = x[length(x) - 20] + ahead / 100 * 2 * pi, #' ahead = NULL #' ) %>% -#' pivot_wider(names_from = quantile_levels, values_from = values) +#' pivot_wider(names_from = distn_quantile_levels, values_from = distn_value) #' plot(x, y, pch = 16, xlim = c(pi, 2 * pi), col = "lightgrey") #' curve(sin(x), add = TRUE) #' abline(v = fd, lty = 2) @@ -171,7 +171,7 @@ make_smooth_quantile_reg <- function() { x <- lapply(unname(split( p, seq(nrow(p)) )), function(q) unname(sort(q, na.last = TRUE))) - dist_quantiles(x, list(object$tau)) + quantile_pred(do.call(rbind, x), object$tau) }) n_preds <- length(list_of_pred_distns[[1]]) nout <- length(list_of_pred_distns) diff --git a/R/pivot_quantiles.R b/R/pivot_quantiles.R index d4ef3d57d..37f08b46f 100644 --- a/R/pivot_quantiles.R +++ b/R/pivot_quantiles.R @@ -1,144 +1,65 @@ -#' Turn a vector of quantile distributions into a list-col +#' Pivot a column containing `quantile_pred` longer #' -#' @param x a `distribution` containing `dist_quantiles` -#' -#' @return a list-col -#' @export -#' -#' @examples -#' edf <- covid_case_death_rates[1:3, ] -#' edf$q <- dist_quantiles(list(1:5, 2:4, 3:10), list(1:5 / 6, 2:4 / 5, 3:10 / 11)) -#' -#' edf_nested <- edf %>% mutate(q = nested_quantiles(q)) -#' edf_nested %>% unnest(q) -nested_quantiles <- function(x) { - stopifnot(is_dist_quantiles(x)) - distributional:::dist_apply(x, .f = function(z) { - as_tibble(vec_data(z)) %>% - mutate(across(everything(), as.double)) %>% - vctrs::list_of() - }) -} - - -#' Pivot columns containing `dist_quantile` longer -#' -#' Selected columns that contain `dist_quantiles` will be "lengthened" with +#' A column that contains `quantile_pred` will be "lengthened" with #' the quantile levels serving as 1 column and the values as another. If #' multiple columns are selected, these will be prefixed with the column name. #' #' @param .data A data frame, or a data frame extension such as a tibble or #' epi_df. -#' @param ... <[`tidy-select`][dplyr::dplyr_tidy_select]> One or more unquoted +#' @param ... <[`tidy-select`][dplyr::dplyr_tidy_select]> One unquoted #' expressions separated by commas. Variable names can be used as if they -#' were positions in the data frame, so expressions like `x:y` can -#' be used to select a range of variables. -#' @param .ignore_length_check If multiple columns are selected, as long as -#' each row has contains the same number of quantiles, the result will be -#' reasonable. But if, for example, `var1[1]` has 5 quantiles while `var2[1]` -#' has 7, then the only option would be to recycle everything, creating a -#' _very_ long result. By default, this would throw an error. But if this is -#' really the goal, then the error can be bypassed by setting this argument -#' to `TRUE`. The quantiles in the first selected column will vary the fastest. +#' were positions in the data frame. Note that only one variable +#' can be selected for this operation. #' #' @return An object of the same class as `.data`. #' @export #' #' @examples -#' d1 <- c(dist_quantiles(1:3, 1:3 / 4), dist_quantiles(2:4, 1:3 / 4)) -#' d2 <- c(dist_quantiles(2:4, 2:4 / 5), dist_quantiles(3:5, 2:4 / 5)) +#' d1 <- quantile_pred(rbind(1:3, 2:4), 1:3 / 4) +#' d2 <- quantile_pred(rbind(2:4, 3:5), 2:4 / 5) #' tib <- tibble(g = c("a", "b"), d1 = d1, d2 = d2) #' #' pivot_quantiles_longer(tib, "d1") #' pivot_quantiles_longer(tib, dplyr::ends_with("1")) -#' pivot_quantiles_longer(tib, d1, d2) -pivot_quantiles_longer <- function(.data, ..., .ignore_length_check = FALSE) { - cols <- validate_pivot_quantiles(.data, ...) - .data <- .data %>% mutate(across(all_of(cols), nested_quantiles)) - if (length(cols) > 1L) { - lengths_check <- .data %>% - dplyr::transmute(across(all_of(cols), ~ map_int(.x, vctrs::vec_size))) %>% - as.matrix() %>% - apply(1, function(x) dplyr::n_distinct(x) == 1L) %>% - all() - if (lengths_check) { - .data <- tidyr::unnest(.data, all_of(cols), names_sep = "_") - } else { - if (.ignore_length_check) { - for (col in cols) { - .data <- .data %>% tidyr::unnest(all_of(col), names_sep = "_") - } - } else { - cli_abort(paste( - "Some selected columns contain different numbers of quantiles.", - "The result would be a {.emph very} long {.cls tibble}.", - "To do this anyway, rerun with `.ignore_length_check = TRUE`." - )) - } - } - } else { - .data <- .data %>% tidyr::unnest(all_of(cols)) - } - .data +#' pivot_quantiles_longer(tib, d2) +pivot_quantiles_longer <- function(.data, ...) { + col <- validate_pivot_quantiles(.data, ...) + .data$.row <- seq_len(vctrs::vec_size(.data)) + long_tib <- as_tibble(.data[[col]]) + .data <- select(.data, !all_of(col)) + names(long_tib)[1:2] <- c(glue::glue("{col}_value"), glue::glue("{col}_quantile_level")) + left_join(.data, long_tib, by = ".row") %>% + select(!.row) } -#' Pivot columns containing `dist_quantile` wider +#' Pivot a column containing `quantile_pred` wider #' -#' Any selected columns that contain `dist_quantiles` will be "widened" with +#' Any selected columns that contain `quantile_pred` will be "widened" with #' the "taus" (quantile) serving as names and the values in the data frame. #' When pivoting multiple columns, the original column name will be used as #' a prefix. #' -#' @param .data A data frame, or a data frame extension such as a tibble or -#' epi_df. -#' @param ... <[`tidy-select`][dplyr::dplyr_tidy_select]> One or more unquoted -#' expressions separated by commas. Variable names can be used as if they -#' were positions in the data frame, so expressions like `x:y` can -#' be used to select a range of variables. +#' @inheritParams pivot_quantiles_longer #' #' @return An object of the same class as `.data` #' @export #' #' @examples -#' d1 <- c(dist_quantiles(1:3, 1:3 / 4), dist_quantiles(2:4, 1:3 / 4)) -#' d2 <- c(dist_quantiles(2:4, 2:4 / 5), dist_quantiles(3:5, 2:4 / 5)) -#' tib <- tibble::tibble(g = c("a", "b"), d1 = d1, d2 = d2) +#' d1 <- quantile_pred(rbind(1:3, 2:4), 1:3 / 4) +#' d2 <- quantile_pred(rbind(2:4, 3:5), 2:4 / 5) +#' tib <- tibble(g = c("a", "b"), d1 = d1, d2 = d2) #' -#' pivot_quantiles_wider(tib, c("d1", "d2")) -#' pivot_quantiles_wider(tib, dplyr::starts_with("d")) +#' pivot_quantiles_wider(tib, "d1") +#' pivot_quantiles_wider(tib, dplyr::ends_with("2")) #' pivot_quantiles_wider(tib, d2) pivot_quantiles_wider <- function(.data, ...) { - cols <- validate_pivot_quantiles(.data, ...) - .data <- .data %>% mutate(across(all_of(cols), nested_quantiles)) - checks <- map_lgl(cols, ~ diff(range(vctrs::list_sizes(.data[[.x]]))) == 0L) - if (!all(checks)) { - nms <- cols[!checks] - cli_abort(c( - "Quantiles must be the same length and have the same set of taus.", - i = "Check failed for variables(s) {.var {nms}}." - )) - } - - # tidyr::pivot_wider can crash if there are duplicates, this generally won't - # happen in our context. To avoid, silently add an index column and remove it - # later - .hidden_index <- seq_len(nrow(.data)) - .data <- tibble::add_column(.data, .hidden_index = .hidden_index) - if (length(cols) > 1L) { - for (col in cols) { - .data <- .data %>% - tidyr::unnest(all_of(col)) %>% - tidyr::pivot_wider( - names_from = "quantile_levels", values_from = "values", - names_prefix = paste0(col, "_") - ) - } - } else { - .data <- .data %>% - tidyr::unnest(all_of(cols)) %>% - tidyr::pivot_wider(names_from = "quantile_levels", values_from = "values") - } - select(.data, -.hidden_index) + col <- validate_pivot_quantiles(.data, ...) + .data$.row <- seq_len(vctrs::vec_size(.data)) + wide_tib <- as_tibble(.data[[col]]) %>% + tidyr::pivot_wider(names_from = .quantile_levels, values_from = .pred_quantile) + .data <- select(.data, !all_of(col)) + left_join(.data, wide_tib, by = ".row") %>% + select(!.row) } pivot_quantiles <- function(.data, ...) { @@ -149,14 +70,19 @@ pivot_quantiles <- function(.data, ...) { lifecycle::deprecate_stop(msg) } -validate_pivot_quantiles <- function(.data, ...) { +validate_pivot_quantiles <- function(.data, ..., call = caller_env()) { expr <- rlang::expr(c(...)) cols <- names(tidyselect::eval_select(expr, .data)) - dqs <- map_lgl(cols, ~ is_dist_quantiles(.data[[.x]])) - if (!all(dqs)) { - nms <- cols[!dqs] + if (length(cols) > 1L) { + cli_abort( + "Only one column can be pivotted. Can not pivot all of: {.var {cols}}.", + call = call + ) + } + if (!inherits(.data[[cols]], "quantile_pred")) { cli_abort( - "Variables(s) {.var {nms}} are not `dist_quantiles`. Cannot pivot them." + "{.var {cols}} is not {.cls `quantile_pred`}. Cannot pivot it.", + call = call ) } cols diff --git a/R/quantile_pred-methods.R b/R/quantile_pred-methods.R index 20379b46e..75c2da70c 100644 --- a/R/quantile_pred-methods.R +++ b/R/quantile_pred-methods.R @@ -1,5 +1,6 @@ # placeholder to avoid errors, but not ideal +#' @importFrom hardhat quantile_pred #' @export mean.quantile_pred <- function(x, na.rm = FALSE, ...) { median(x, ...) @@ -46,6 +47,7 @@ quantile_internal <- function(x, tau_out, middle) { extrapolate_quantiles_single <- function(qvals, tau, tau_out, middle) { qvals_out <- rep(NA, length(tau_out)) good <- !is.na(qvals) + if (!any(good)) return(qvals_out) qvals <- qvals[good] tau <- tau[good] @@ -131,7 +133,7 @@ vec_math.quantile_pred <- function(.fn, .x, ...) { } quantile_levels <- .x %@% "quantile_levels" .x <- as.matrix(.x) - hardhat::quantile_pred(.fn(.x), quantile_levels) + quantile_pred(.fn(.x), quantile_levels) } #' @importFrom vctrs vec_arith vec_arith.numeric @@ -145,14 +147,16 @@ vec_arith.quantile_pred <- function(op, x, y, ...) { #' @method vec_arith.quantile_pred numeric vec_arith.quantile_pred.numeric <- function(op, x, y, ...) { op_fn <- getExportedValue("base", op) - out <- op_fn(as.matrix(x), y) - hardhat::quantile_pred(out, x %@% "quantile_levels") + l <- vctrs::vec_recycle_common(x = x, y = y) + out <- op_fn(as.matrix(l$x), l$y) + quantile_pred(out, x %@% "quantile_levels") } #' @export #' @method vec_arith.numeric quantile_pred vec_arith.numeric.quantile_pred <- function(op, x, y, ...) { op_fn <- getExportedValue("base", op) - out <- op_fn(x, as.matrix(y)) - hardhat::quantile_pred(out, y %@% "quantile_levels") + l <- vctrs::vec_recycle_common(x = x, y = y) + out <- op_fn(l$x, as.matrix(l$y)) + quantile_pred(out, y %@% "quantile_levels") } diff --git a/R/weighted_interval_score.R b/R/weighted_interval_score.R index 567ae4e69..aa0c816a3 100644 --- a/R/weighted_interval_score.R +++ b/R/weighted_interval_score.R @@ -7,22 +7,21 @@ #' al. (2020)](https://arxiv.org/abs/2005.12881) for discussion in the context #' of COVID-19 forecasting. #' -#' @param x distribution. A vector of class distribution. Ideally, this vector -#' contains `dist_quantiles()`, though other distributions are supported when -#' `quantile_levels` is specified. See below. +#' @param x A vector of class `quantile_pred`. #' @param actual double. Actual value(s) #' @param quantile_levels probabilities. If specified, the score will be -#' computed at this set of levels. -#' @param na_handling character. Determines how `quantile_levels` without a -#' corresponding `value` are handled. For `"impute"`, missing values will be +#' computed at this set of levels. Otherwise, those present in `x` will be +#' used. +#' @param na_handling character. Determines missing values are handled. +#' For `"impute"`, missing values will be #' calculated if possible using the available quantiles. For `"drop"`, #' explicitly missing values are ignored in the calculation of the score, but #' implicitly missing values are imputed if possible. #' For `"propogate"`, the resulting score will be `NA` if any missing values -#' exist in the original `quantile_levels`. Finally, if +#' exist. Finally, if #' `quantile_levels` is specified, `"fail"` will result in #' the score being `NA` when any required quantile levels (implicit or explicit) -#' are do not have corresponding values. +#' do not have corresponding values. #' @param ... not used #' #' @return a vector of nonnegative scores. @@ -30,24 +29,23 @@ #' @export #' @examples #' quantile_levels <- c(.2, .4, .6, .8) -#' predq_1 <- 1:4 # -#' predq_2 <- 8:11 -#' dstn <- dist_quantiles(list(predq_1, predq_2), quantile_levels) +#' predq1 <- 1:4 # +#' predq2 <- 8:11 +#' dstn <- quantile_pred(rbind(predq1, predq2), quantile_levels) #' actual <- c(3.3, 7.1) #' weighted_interval_score(dstn, actual) #' weighted_interval_score(dstn, actual, c(.25, .5, .75)) #' -#' library(distributional) -#' dstn <- dist_normal(c(.75, 2)) -#' weighted_interval_score(dstn, 1, c(.25, .5, .75)) -#' #' # Missing value behaviours -#' dstn <- dist_quantiles(c(1, 2, NA, 4), 1:4 / 5) +#' dstn <- quantile_pred(matrix(c(1, 2, NA, 4), nrow = 1), 1:4 / 5) #' weighted_interval_score(dstn, 2.5) #' weighted_interval_score(dstn, 2.5, 1:9 / 10) #' weighted_interval_score(dstn, 2.5, 1:9 / 10, na_handling = "drop") #' weighted_interval_score(dstn, 2.5, na_handling = "propagate") -#' weighted_interval_score(dist_quantiles(1:4, 1:4 / 5), 2.5, 1:9 / 10, +#' weighted_interval_score( +#' quantile_pred(matrix(1:4, nrow = 1), 1:4 / 5), +#' actual = 2.5, +#' quantile_levels = 1:9 / 10, #' na_handling = "fail" #' ) #' @@ -101,7 +99,7 @@ weighted_interval_score.quantile_pred <- function( } tau <- quantile_levels %||% old_quantile_levels x <- extrapolate_quantiles(x, tau, replace_na = (na_handling == "impute")) - x <- as.matrix(x)[, attr(x, "quantile_levels") %in% tau] + x <- as.matrix(x)[, attr(x, "quantile_levels") %in% tau, drop = FALSE] na_rm <- (na_handling == "drop") map2_dbl(vctrs::vec_chop(x), actual, ~ wis_one_quantile(.x, tau, .y, na_rm)) } diff --git a/man/extrapolate_quantiles.Rd b/man/extrapolate_quantiles.Rd index 4b1d1282c..b645b85fa 100644 --- a/man/extrapolate_quantiles.Rd +++ b/man/extrapolate_quantiles.Rd @@ -7,37 +7,29 @@ extrapolate_quantiles(x, probs, replace_na = TRUE, ...) } \arguments{ -\item{x}{a \code{distribution} vector} +\item{x}{A vector of class \code{quantile_pred}.} \item{probs}{a vector of probabilities at which to calculate quantiles} \item{replace_na}{logical. If \code{x} contains \code{NA}'s, these are imputed if -possible (if \code{TRUE}) or retained (if \code{FALSE}). This only effects -elements of class \code{dist_quantiles}.} +possible (if \code{TRUE}) or retained (if \code{FALSE}).} \item{...}{additional arguments passed on to the \code{quantile} method} } \value{ -a \code{distribution} vector containing \code{dist_quantiles}. Any elements -of \code{x} which were originally \code{dist_quantiles} will now have a superset +a \code{quantile_pred} vector. Each element +of \code{x} will now have a superset of the original \code{quantile_values} (the union of those and \code{probs}). } \description{ -Summarize a distribution with a set of quantiles +This function takes a \code{quantile_pred} vector and returns the same +type of object, expanded to include +\emph{additional} quantiles computed at \code{probs}. If you want behaviour more +similar to \code{\link[stats:quantile]{stats::quantile()}}, then \code{quantile(x,...)} may be more +appropriate. } \examples{ -library(distributional) -dstn <- dist_normal(c(10, 2), c(5, 10)) -extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75)) - -dstn <- dist_quantiles(list(1:4, 8:11), list(c(.2, .4, .6, .8))) -# because this distribution is already quantiles, any extra quantiles are -# appended -extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75)) - -dstn <- c( - dist_normal(c(10, 2), c(5, 10)), - dist_quantiles(list(1:4, 8:11), list(c(.2, .4, .6, .8))) -) -extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75)) +dstn <- quantile_dstn(rbind(1:4, 8:11), c(.2, .4, .6, .8)) +# extra quantiles are appended +as.tibble(extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75))) } diff --git a/man/layer_cdc_flatline_quantiles.Rd b/man/layer_cdc_flatline_quantiles.Rd index 35a6c03e8..12b173da1 100644 --- a/man/layer_cdc_flatline_quantiles.Rd +++ b/man/layer_cdc_flatline_quantiles.Rd @@ -62,7 +62,7 @@ an updated \code{frosting} postprocessor. Calling \code{\link[=predict]{predict( in an additional \verb{} named \code{.pred_distn_all} containing 2-column \code{\link[tibble:tibble]{tibble::tibble()}}'s. For each desired combination of \code{key}'s, the tibble will contain one row per ahead -with the associated \code{\link[=dist_quantiles]{dist_quantiles()}}. +with the associated \code{\link[=quantile_pred]{quantile_pred()}}. } \description{ This layer creates quantile forecasts by taking a sample from the diff --git a/man/nested_quantiles.Rd b/man/nested_quantiles.Rd deleted file mode 100644 index b1571450e..000000000 --- a/man/nested_quantiles.Rd +++ /dev/null @@ -1,24 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pivot_quantiles.R -\name{nested_quantiles} -\alias{nested_quantiles} -\title{Turn a vector of quantile distributions into a list-col} -\usage{ -nested_quantiles(x) -} -\arguments{ -\item{x}{a \code{distribution} containing \code{dist_quantiles}} -} -\value{ -a list-col -} -\description{ -Turn a vector of quantile distributions into a list-col -} -\examples{ -edf <- covid_case_death_rates[1:3, ] -edf$q <- dist_quantiles(list(1:5, 2:4, 3:10), list(1:5 / 6, 2:4 / 5, 3:10 / 11)) - -edf_nested <- edf \%>\% mutate(q = nested_quantiles(q)) -edf_nested \%>\% unnest(q) -} diff --git a/man/pivot_quantiles_longer.Rd b/man/pivot_quantiles_longer.Rd index 9879d5d07..b872d0c97 100644 --- a/man/pivot_quantiles_longer.Rd +++ b/man/pivot_quantiles_longer.Rd @@ -2,41 +2,33 @@ % Please edit documentation in R/pivot_quantiles.R \name{pivot_quantiles_longer} \alias{pivot_quantiles_longer} -\title{Pivot columns containing \code{dist_quantile} longer} +\title{Pivot a column containing \code{quantile_pred} longer} \usage{ -pivot_quantiles_longer(.data, ..., .ignore_length_check = FALSE) +pivot_quantiles_longer(.data, ...) } \arguments{ \item{.data}{A data frame, or a data frame extension such as a tibble or epi_df.} -\item{...}{<\code{\link[dplyr:dplyr_tidy_select]{tidy-select}}> One or more unquoted +\item{...}{<\code{\link[dplyr:dplyr_tidy_select]{tidy-select}}> One unquoted expressions separated by commas. Variable names can be used as if they -were positions in the data frame, so expressions like \code{x:y} can -be used to select a range of variables.} - -\item{.ignore_length_check}{If multiple columns are selected, as long as -each row has contains the same number of quantiles, the result will be -reasonable. But if, for example, \code{var1[1]} has 5 quantiles while \code{var2[1]} -has 7, then the only option would be to recycle everything, creating a -\emph{very} long result. By default, this would throw an error. But if this is -really the goal, then the error can be bypassed by setting this argument -to \code{TRUE}. The quantiles in the first selected column will vary the fastest.} +were positions in the data frame. Note that only one variable +can be selected for this operation.} } \value{ An object of the same class as \code{.data}. } \description{ -Selected columns that contain \code{dist_quantiles} will be "lengthened" with +A column that contains \code{quantile_pred} will be "lengthened" with the quantile levels serving as 1 column and the values as another. If multiple columns are selected, these will be prefixed with the column name. } \examples{ -d1 <- c(dist_quantiles(1:3, 1:3 / 4), dist_quantiles(2:4, 1:3 / 4)) -d2 <- c(dist_quantiles(2:4, 2:4 / 5), dist_quantiles(3:5, 2:4 / 5)) +d1 <- quantile_pred(rbind(1:3, 2:4), 1:3 / 4) +d2 <- quantile_pred(rbind(2:4, 3:5), 2:4 / 5) tib <- tibble(g = c("a", "b"), d1 = d1, d2 = d2) pivot_quantiles_longer(tib, "d1") pivot_quantiles_longer(tib, dplyr::ends_with("1")) -pivot_quantiles_longer(tib, d1, d2) +pivot_quantiles_longer(tib, d2) } diff --git a/man/pivot_quantiles_wider.Rd b/man/pivot_quantiles_wider.Rd index e477777ca..01f85a70a 100644 --- a/man/pivot_quantiles_wider.Rd +++ b/man/pivot_quantiles_wider.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/pivot_quantiles.R \name{pivot_quantiles_wider} \alias{pivot_quantiles_wider} -\title{Pivot columns containing \code{dist_quantile} wider} +\title{Pivot a column containing \code{quantile_pred} wider} \usage{ pivot_quantiles_wider(.data, ...) } @@ -10,26 +10,26 @@ pivot_quantiles_wider(.data, ...) \item{.data}{A data frame, or a data frame extension such as a tibble or epi_df.} -\item{...}{<\code{\link[dplyr:dplyr_tidy_select]{tidy-select}}> One or more unquoted +\item{...}{<\code{\link[dplyr:dplyr_tidy_select]{tidy-select}}> One unquoted expressions separated by commas. Variable names can be used as if they -were positions in the data frame, so expressions like \code{x:y} can -be used to select a range of variables.} +were positions in the data frame. Note that only one variable +can be selected for this operation.} } \value{ An object of the same class as \code{.data} } \description{ -Any selected columns that contain \code{dist_quantiles} will be "widened" with +Any selected columns that contain \code{quantile_pred} will be "widened" with the "taus" (quantile) serving as names and the values in the data frame. When pivoting multiple columns, the original column name will be used as a prefix. } \examples{ -d1 <- c(dist_quantiles(1:3, 1:3 / 4), dist_quantiles(2:4, 1:3 / 4)) -d2 <- c(dist_quantiles(2:4, 2:4 / 5), dist_quantiles(3:5, 2:4 / 5)) -tib <- tibble::tibble(g = c("a", "b"), d1 = d1, d2 = d2) +d1 <- quantile_pred(rbind(1:3, 2:4), 1:3 / 4) +d2 <- quantile_pred(rbind(2:4, 3:5), 2:4 / 5) +tib <- tibble(g = c("a", "b"), d1 = d1, d2 = d2) -pivot_quantiles_wider(tib, c("d1", "d2")) -pivot_quantiles_wider(tib, dplyr::starts_with("d")) +pivot_quantiles_wider(tib, "d1") +pivot_quantiles_wider(tib, dplyr::ends_with("2")) pivot_quantiles_wider(tib, d2) } diff --git a/man/smooth_quantile_reg.Rd b/man/smooth_quantile_reg.Rd index eb715be63..973a85879 100644 --- a/man/smooth_quantile_reg.Rd +++ b/man/smooth_quantile_reg.Rd @@ -66,7 +66,7 @@ pl <- pl \%>\% x = x[length(x) - 20] + ahead / 100 * 2 * pi, ahead = NULL ) \%>\% - pivot_wider(names_from = quantile_levels, values_from = values) + pivot_wider(names_from = distn_quantile_levels, values_from = distn_value) plot(x, y, pch = 16, xlim = c(pi, 2 * pi), col = "lightgrey") curve(sin(x), add = TRUE) abline(v = fd, lty = 2) diff --git a/man/weighted_interval_score.Rd b/man/weighted_interval_score.Rd index 4b7c796ea..22a616b70 100644 --- a/man/weighted_interval_score.Rd +++ b/man/weighted_interval_score.Rd @@ -13,25 +13,24 @@ weighted_interval_score( ) } \arguments{ -\item{x}{distribution. A vector of class distribution. Ideally, this vector -contains \code{dist_quantiles()}, though other distributions are supported when -\code{quantile_levels} is specified. See below.} +\item{x}{A vector of class \code{quantile_pred}.} \item{actual}{double. Actual value(s)} \item{quantile_levels}{probabilities. If specified, the score will be -computed at this set of levels.} +computed at this set of levels. Otherwise, those present in \code{x} will be +used.} -\item{na_handling}{character. Determines how \code{quantile_levels} without a -corresponding \code{value} are handled. For \code{"impute"}, missing values will be +\item{na_handling}{character. Determines missing values are handled. +For \code{"impute"}, missing values will be calculated if possible using the available quantiles. For \code{"drop"}, explicitly missing values are ignored in the calculation of the score, but implicitly missing values are imputed if possible. For \code{"propogate"}, the resulting score will be \code{NA} if any missing values -exist in the original \code{quantile_levels}. Finally, if +exist. Finally, if \code{quantile_levels} is specified, \code{"fail"} will result in the score being \code{NA} when any required quantile levels (implicit or explicit) -are do not have corresponding values.} +do not have corresponding values.} \item{...}{not used} } @@ -47,24 +46,23 @@ of COVID-19 forecasting. } \examples{ quantile_levels <- c(.2, .4, .6, .8) -predq_1 <- 1:4 # -predq_2 <- 8:11 -dstn <- dist_quantiles(list(predq_1, predq_2), quantile_levels) +predq1 <- 1:4 # +predq2 <- 8:11 +dstn <- quantile_pred(rbind(predq1, predq2), quantile_levels) actual <- c(3.3, 7.1) weighted_interval_score(dstn, actual) weighted_interval_score(dstn, actual, c(.25, .5, .75)) -library(distributional) -dstn <- dist_normal(c(.75, 2)) -weighted_interval_score(dstn, 1, c(.25, .5, .75)) - # Missing value behaviours -dstn <- dist_quantiles(c(1, 2, NA, 4), 1:4 / 5) +dstn <- quantile_pred(matrix(c(1, 2, NA, 4), nrow = 1), 1:4 / 5) weighted_interval_score(dstn, 2.5) weighted_interval_score(dstn, 2.5, 1:9 / 10) weighted_interval_score(dstn, 2.5, 1:9 / 10, na_handling = "drop") weighted_interval_score(dstn, 2.5, na_handling = "propagate") -weighted_interval_score(dist_quantiles(1:4, 1:4 / 5), 2.5, 1:9 / 10, +weighted_interval_score( + quantile_pred(matrix(1:4, nrow = 1), 1:4 / 5), + actual = 2.5, + quantile_levels = 1:9 / 10, na_handling = "fail" ) diff --git a/tests/testthat/_snaps/pivot_quantiles.md b/tests/testthat/_snaps/pivot_quantiles.md index ca775a18f..13dd81916 100644 --- a/tests/testthat/_snaps/pivot_quantiles.md +++ b/tests/testthat/_snaps/pivot_quantiles.md @@ -3,47 +3,38 @@ Code pivot_quantiles_wider(tib, a) Condition - Error in `UseMethod()`: - ! no applicable method for 'family' applied to an object of class "c('integer', 'numeric')" + Error in `pivot_quantiles_wider()`: + ! `a` is not <`quantile_pred`>. Cannot pivot it. --- Code - pivot_quantiles_wider(tib, c) + pivot_quantiles_wider(tib, d1, d2) Condition - Error in `validate_pivot_quantiles()`: - ! Variables(s) `c` are not `dist_quantiles`. Cannot pivot them. + Error in `pivot_quantiles_wider()`: + ! Only one column can be pivotted. Can not pivot all of: `d1` and `d2`. --- Code - pivot_quantiles_wider(tib, d1) + pivot_quantiles_longer(tib, d1, d2) Condition - Error in `pivot_quantiles_wider()`: - ! Quantiles must be the same length and have the same set of taus. - i Check failed for variables(s) `d1`. + Error in `pivot_quantiles_longer()`: + ! Only one column can be pivotted. Can not pivot all of: `d1` and `d2`. # quantile pivotting longer behaves Code pivot_quantiles_longer(tib, a) Condition - Error in `UseMethod()`: - ! no applicable method for 'family' applied to an object of class "c('integer', 'numeric')" - ---- - - Code - pivot_quantiles_longer(tib, c) - Condition - Error in `validate_pivot_quantiles()`: - ! Variables(s) `c` are not `dist_quantiles`. Cannot pivot them. + Error in `pivot_quantiles_longer()`: + ! `a` is not <`quantile_pred`>. Cannot pivot it. --- Code - pivot_quantiles_longer(tib, d1, d3) + pivot_quantiles_longer(tib, d1, d2) Condition Error in `pivot_quantiles_longer()`: - ! Some selected columns contain different numbers of quantiles. The result would be a very long . To do this anyway, rerun with `.ignore_length_check = TRUE`. + ! Only one column can be pivotted. Can not pivot all of: `d1` and `d2`. diff --git a/tests/testthat/_snaps/wis-quantile_pred.md b/tests/testthat/_snaps/wis-quantile_pred.md new file mode 100644 index 000000000..f13bd74db --- /dev/null +++ b/tests/testthat/_snaps/wis-quantile_pred.md @@ -0,0 +1,16 @@ +# wis dispatches and produces the correct values + + Code + weighted_interval_score(1:10, 10) + Condition + Error in `UseMethod()`: + ! no applicable method for 'weighted_interval_score' applied to an object of class "c('integer', 'numeric')" + +--- + + Code + weighted_interval_score(quantile_pred(rbind(1:4, 8:11), 1:4 / 5), 1:3) + Condition + Error in `weighted_interval_score.quantile_pred()`: + ! Assertion on 'actual' failed: Must have length 2, but has length 3. + diff --git a/tests/testthat/test-layer_residual_quantiles.R b/tests/testthat/test-layer_residual_quantiles.R index 1736ded2d..2941037f5 100644 --- a/tests/testthat/test-layer_residual_quantiles.R +++ b/tests/testthat/test-layer_residual_quantiles.R @@ -23,11 +23,9 @@ test_that("Returns expected number or rows and columns", { expect_equal(nrow(p), 3L) expect_named(p, c("geo_value", "time_value", ".pred", ".pred_distn")) - nested <- p %>% dplyr::mutate(.quantiles = nested_quantiles(.pred_distn)) - unnested <- nested %>% tidyr::unnest(.quantiles) - + unnested <- p %>% pivot_quantiles_longer(.pred_distn) expect_equal(nrow(unnested), 12L) - expect_equal(unique(unnested$quantile_levels), c(.0275, .5, .8, .95)) + expect_equal(unique(unnested$.pred_distn_quantile_level), c(.0275, 0.5, .8, .95)) }) diff --git a/tests/testthat/test-layer_threshold_preds.R b/tests/testthat/test-layer_threshold_preds.R index 2ff43a165..64e8608b2 100644 --- a/tests/testthat/test-layer_threshold_preds.R +++ b/tests/testthat/test-layer_threshold_preds.R @@ -56,11 +56,10 @@ test_that("thresholds additional columns", { expect_equal(round(p$.pred, digits = 3), c(0.180, 0.180, 0.310)) expect_named(p, c("geo_value", "time_value", ".pred", ".pred_distn")) p <- p %>% - dplyr::mutate(.quantiles = nested_quantiles(.pred_distn)) %>% - tidyr::unnest(.quantiles) + pivot_quantiles_longer(.pred_distn) expect_equal( - round(p$values, digits = 3), - c(0.180, 0.180, 0.31, 0.180, 0.180, .18, 0.310, .31, .31) + round(p$.pred_distn_value, digits = 3), + c(0.180, 0.180, 0.31, 0.180, .18, .18, .31, 0.310, .31) ) - expect_equal(p$quantile_levels, rep(c(.1, 0.5, .9), times = 3)) + expect_equal(p$.pred_distn_quantile_level, rep(c(.1, 0.5, .9), times = 3)) }) diff --git a/tests/testthat/test-pivot_quantiles.R b/tests/testthat/test-pivot_quantiles.R index 1639058e2..a4362cffb 100644 --- a/tests/testthat/test-pivot_quantiles.R +++ b/tests/testthat/test-pivot_quantiles.R @@ -1,76 +1,44 @@ test_that("quantile pivotting wider behaves", { tib <- tibble::tibble(a = 1:5, b = 6:10) expect_snapshot(error = TRUE, pivot_quantiles_wider(tib, a)) - tib$c <- rep(dist_normal(), 5) - expect_snapshot(error = TRUE, pivot_quantiles_wider(tib, c)) - d1 <- c(dist_quantiles(1:3, 1:3 / 4), dist_quantiles(2:5, 1:4 / 5)) - # different quantiles - tib <- tib[1:2, ] - tib$d1 <- d1 - expect_snapshot(error = TRUE, pivot_quantiles_wider(tib, d1)) - - d1 <- c(dist_quantiles(1:3, 1:3 / 4), dist_quantiles(2:4, 2:4 / 4)) - tib$d1 <- d1 - # would want to error (mismatched quantiles), but hard to check efficiently - expect_silent(pivot_quantiles_wider(tib, d1)) + d1 <- quantile_pred(rbind(1:3, 2:4), 1:3 / 4) + d2 <- quantile_pred(rbind(2:4, 3:5), 2:4 / 5) + tib <- tibble(g = c("a", "b"), d1 = d1, d2 = d2) - d1 <- c(dist_quantiles(1:3, 1:3 / 4), dist_quantiles(2:4, 1:3 / 4)) - d2 <- c(dist_quantiles(2:4, 2:4 / 5), dist_quantiles(3:5, 2:4 / 5)) - tib <- tibble::tibble(g = c("a", "b"), d1 = d1, d2 = d2) + # too many columns + expect_snapshot(error = TRUE, pivot_quantiles_wider(tib, d1, d2)) + expect_snapshot(error = TRUE, pivot_quantiles_longer(tib, d1, d2)) - expect_length(pivot_quantiles_wider(tib, c("d1", "d2")), 7L) - expect_length(pivot_quantiles_wider(tib, tidyselect::starts_with("d")), 7L) - expect_length(pivot_quantiles_wider(tib, d2), 5L) + expect_length(pivot_quantiles_wider(tib, d1), 5L) + expect_length(pivot_quantiles_wider(tib, tidyselect::ends_with("1")), 5L) + expect_equal(vctrs::vec_size(pivot_quantiles_longer(tib, d2)), 6L) }) test_that("pivotting wider still works if there are duplicates", { # previously this would produce a warning if pivotted because the # two rows of the result are identical - tb <- tibble(.pred = dist_quantiles(list(1:3, 1:3), list(c(.1, .5, .9)))) + tb <- tibble(.pred = quantile_pred(rbind(1:3, 1:3), c(.1, .5, .9))) res <- tibble(`0.1` = c(1, 1), `0.5` = c(2, 2), `0.9` = c(3, 3)) - expect_identical(tb %>% pivot_quantiles_wider(.pred), res) + expect_equal(tb %>% pivot_quantiles_wider(.pred), res) }) test_that("quantile pivotting longer behaves", { tib <- tibble::tibble(a = 1:5, b = 6:10) expect_snapshot(error = TRUE, pivot_quantiles_longer(tib, a)) - tib$c <- rep(dist_normal(), 5) - expect_snapshot(error = TRUE, pivot_quantiles_longer(tib, c)) - - d1 <- c(dist_quantiles(1:3, 1:3 / 4), dist_quantiles(2:5, 1:4 / 5)) - # different quantiles - tib <- tib[1:2, ] - tib$d1 <- d1 - expect_length(pivot_quantiles_longer(tib, d1), 5L) - expect_identical(nrow(pivot_quantiles_longer(tib, d1)), 7L) - expect_identical(pivot_quantiles_longer(tib, d1)$values, as.double(c(1:3, 2:5))) - - d1 <- c(dist_quantiles(1:3, 1:3 / 4), dist_quantiles(2:4, 2:4 / 4)) - tib$d1 <- d1 - expect_silent(pivot_quantiles_longer(tib, d1)) - d1 <- c(dist_quantiles(1:3, 1:3 / 4), dist_quantiles(2:4, 1:3 / 4)) - d2 <- c(dist_quantiles(2:4, 2:4 / 5), dist_quantiles(3:5, 2:4 / 5)) - tib <- tibble::tibble(g = c("a", "b"), d1 = d1, d2 = d2) + d1 <- quantile_pred(rbind(1:3, 2:4), 1:3 / 4) + d2 <- quantile_pred(rbind(2:4, 3:5), 2:4 / 5) + tib <- tibble(g = c("a", "b"), d1 = d1, d2 = d2) + # too many columns + expect_snapshot(error = TRUE, pivot_quantiles_longer(tib, d1, d2)) - expect_length(pivot_quantiles_longer(tib, c("d1", "d2")), 5L) - expect_identical(nrow(pivot_quantiles_longer(tib, c("d1", "d2"))), 6L) - expect_silent(pivot_quantiles_longer(tib, tidyselect::starts_with("d"))) - expect_length(pivot_quantiles_longer(tib, d2), 4L) + # different quantiles + expect_length(pivot_quantiles_longer(tib, d1), 4L) + expect_identical(nrow(pivot_quantiles_longer(tib, d1)), 6L) + expect_identical(pivot_quantiles_longer(tib, d1)$d1_value, c(1:3, 2:4)) - tib$d3 <- c(dist_quantiles(2:5, 2:5 / 6), dist_quantiles(3:6, 2:5 / 6)) - # now the cols have different numbers of quantiles - expect_snapshot(error = TRUE, pivot_quantiles_longer(tib, d1, d3)) - expect_length( - pivot_quantiles_longer(tib, d1, d3, .ignore_length_check = TRUE), - 6L - ) - expect_identical( - pivot_quantiles_longer(tib, d1, d3, .ignore_length_check = TRUE)$d1_values, - as.double(rep(c(1:3, 2:4), each = 4)) - ) }) diff --git a/tests/testthat/test-wis-dist-quantiles.R b/tests/testthat/test-wis-quantile_pred.R similarity index 65% rename from tests/testthat/test-wis-dist-quantiles.R rename to tests/testthat/test-wis-quantile_pred.R index 937793189..187344af9 100644 --- a/tests/testthat/test-wis-dist-quantiles.R +++ b/tests/testthat/test-wis-quantile_pred.R @@ -8,45 +8,38 @@ test_that("wis dispatches and produces the correct values", { actual <- 5 expected <- c(wis_one_pred(q1, tau, actual), wis_one_pred(q2, tau, actual)) - dstn <- dist_quantiles(list(q1, q2), tau) + dstn <- quantile_pred(rbind(q1, q2), tau) expect_equal(weighted_interval_score(dstn, actual), expected) # works with a single dstn q <- sort(10 * rexp(23)) tau0 <- c(.01, .025, 1:19 / 20, .975, .99) - dst <- dist_quantiles(q, tau0) + dst <- quantile_pred(rbind(q), tau0) expect_equal(weighted_interval_score(dst, 10), wis_one_pred(q, tau0, 10)) # returns NA when expected - dst <- dist_quantiles(rep(NA, 3), c(.2, .5, .95)) + dst <- quantile_pred(rbind(rep(NA, 3)), c(.2, .5, .95)) expect_true(is.na(weighted_interval_score(dst, 10))) expect_equal( weighted_interval_score(dstn, c(NA, actual)), c(NA, wis_one_pred(q2, tau, actual)) ) - # errors for non distributions + # errors for non quantile_pred expect_snapshot(error = TRUE, weighted_interval_score(1:10, 10)) - expect_warning(w <- weighted_interval_score(dist_normal(1), 10)) - expect_true(all(is.na(w))) - expect_warning(w <- weighted_interval_score( - c(dist_normal(), dist_quantiles(1:5, 1:5 / 6)), - 10 - )) - expect_equal(w, c(NA, wis_one_pred(1:5, 1:5 / 6, 10))) # errors if sizes don't match expect_snapshot(error = TRUE, weighted_interval_score( - dist_quantiles(list(1:4, 8:11), 1:4 / 5), # length 2 + quantile_pred(rbind(1:4, 8:11), 1:4 / 5), # length 2 1:3 )) #' # Missing value behaviours - dstn <- dist_quantiles(c(1, 2, NA, 4), 1:4 / 5) + dstn <- quantile_pred(rbind(c(1, 2, NA, 4)), 1:4 / 5) expect_equal(weighted_interval_score(dstn, 2.5), 0.5) expect_equal(weighted_interval_score(dstn, 2.5, c(2, 4, 5, 6, 8) / 10), 0.4) expect_equal( - weighted_interval_score(dist_quantiles(c(1, 2, NA, 4), 1:4 / 5), 3, na_handling = "drop"), + weighted_interval_score(dstn, 3, na_handling = "drop"), 2 / 3 ) expect_equal( @@ -56,5 +49,9 @@ test_that("wis dispatches and produces the correct values", { expect_true(is.na( weighted_interval_score(dstn, 2.5, na_handling = "propagate") )) - weighted_interval_score(dist_quantiles(1:4, 1:4 / 5), 2.5, 1:9 / 10, na_handling = "fail") + expect_true(is.na( + weighted_interval_score( + quantile_pred(rbind(1:4), 1:4 / 5), 2.5, 1:9 / 10, na_handling = "fail" + ) + )) }) From b7b441659a431ca5b26ee93e8c66861d614dc176 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Mon, 24 Feb 2025 18:01:51 -0800 Subject: [PATCH 07/22] tests pass, checks don't --- NAMESPACE | 12 +- R/epipredict-package.R | 1 + R/extrapolate_quantiles.R | 4 +- R/layer_point_from_distn.R | 6 +- R/layer_threshold_preds.R | 1 + R/pivot_quantiles.R | 50 + R/quantile_pred-methods.R | 105 ++ R/reexports-tidymodels.R | 37 + R/utils-misc.R | 2 +- man/dist_quantiles.Rd | 28 + man/extrapolate_quantiles.Rd | 4 +- man/nested_quantiles.Rd | 31 + man/reexports.Rd | 7 +- tests/testthat/_snaps/dist_quantiles.md | 56 - tests/testthat/_snaps/pivot_quantiles.md | 18 + tests/testthat/_snaps/snapshots.md | 1484 +++++++------------ tests/testthat/_snaps/wis-dist-quantiles.md | 17 - tests/testthat/test-grf_quantiles.R | 2 +- tests/testthat/test-pivot_quantiles.R | 9 + tests/testthat/test-population_scaling.R | 13 +- tests/testthat/test-step_adjust_latency.R | 8 +- 21 files changed, 829 insertions(+), 1066 deletions(-) create mode 100644 R/reexports-tidymodels.R create mode 100644 man/dist_quantiles.Rd create mode 100644 man/nested_quantiles.Rd delete mode 100644 tests/testthat/_snaps/dist_quantiles.md delete mode 100644 tests/testthat/_snaps/wis-dist-quantiles.md diff --git a/NAMESPACE b/NAMESPACE index 204175a04..4c43e2f45 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -119,6 +119,7 @@ S3method(vec_arith,quantile_pred) S3method(vec_arith.numeric,quantile_pred) S3method(vec_arith.quantile_pred,numeric) S3method(vec_math,quantile_pred) +S3method(vec_proxy_equal,quantile_pred) S3method(weighted_interval_score,quantile_pred) export("%>%") export(Add_model) @@ -137,7 +138,6 @@ export(arx_class_epi_workflow) export(arx_classifier) export(arx_fcast_epi_workflow) export(arx_forecaster) -export(as_epi_df) export(as_tibble) export(autoplot) export(bake) @@ -149,12 +149,14 @@ export(climate_args_list) export(climatological_forecaster) export(default_epi_recipe_blueprint) export(detect_layer) +export(dist_quantiles) export(epi_recipe) export(epi_recipe_blueprint) export(epi_workflow) export(extract_argument) export(extract_frosting) export(extract_layers) +export(extract_quantile_levels) export(extrapolate_quantiles) export(filter) export(fit) @@ -182,6 +184,7 @@ export(layer_quantile_distn) export(layer_residual_quantiles) export(layer_threshold) export(layer_unnest) +export(nested_quantiles) export(new_default_epi_recipe_blueprint) export(new_epi_recipe_blueprint) export(pivot_longer) @@ -189,6 +192,7 @@ export(pivot_quantiles_longer) export(pivot_quantiles_wider) export(pivot_wider) export(prep) +export(quantile_pred) export(quantile_reg) export(rand_id) export(remove_epi_recipe) @@ -276,6 +280,7 @@ importFrom(ggplot2,geom_linerange) importFrom(ggplot2,geom_point) importFrom(ggplot2,geom_ribbon) importFrom(glue,glue) +importFrom(hardhat,extract_quantile_levels) importFrom(hardhat,extract_recipe) importFrom(hardhat,quantile_pred) importFrom(hardhat,refresh_blueprint) @@ -284,6 +289,7 @@ importFrom(lubridate,"%m-%") importFrom(lubridate,leap_year) importFrom(lubridate,month) importFrom(lubridate,yday) +importFrom(lifecycle,deprecated) importFrom(magrittr,"%>%") importFrom(magrittr,extract2) importFrom(recipes,bake) @@ -330,8 +336,12 @@ importFrom(tidyr,pivot_wider) importFrom(tidyr,unnest) importFrom(tidyselect,all_of) importFrom(utils,capture.output) +importFrom(vctrs,as_list_of) +importFrom(vctrs,new_vctr) importFrom(vctrs,vec_arith) importFrom(vctrs,vec_arith.numeric) importFrom(vctrs,vec_cast) importFrom(vctrs,vec_math) +importFrom(vctrs,vec_proxy_equal) +importFrom(vctrs,vec_recycle_common) importFrom(workflows,extract_preprocessor) diff --git a/R/epipredict-package.R b/R/epipredict-package.R index 9ee832580..fae8c3c65 100644 --- a/R/epipredict-package.R +++ b/R/epipredict-package.R @@ -10,6 +10,7 @@ #' @importFrom dplyr inner_join #' @importFrom dplyr summarize filter mutate select left_join rename ungroup #' @importFrom epiprocess growth_rate growth_rate_params is_epi_df +#' @importFrom lifecycle deprecated #' @importFrom magrittr extract2 #' @importFrom rlang := !! %||% as_function global_env set_names !!! caller_arg #' @importFrom rlang is_logical is_true inject enquo enquos expr sym arg_match diff --git a/R/extrapolate_quantiles.R b/R/extrapolate_quantiles.R index 82116c1d3..c7a9a3b6b 100644 --- a/R/extrapolate_quantiles.R +++ b/R/extrapolate_quantiles.R @@ -18,9 +18,9 @@ #' @export #' #' @examples -#' dstn <- quantile_dstn(rbind(1:4, 8:11), c(.2, .4, .6, .8)) +#' dstn <- quantile_pred(rbind(1:4, 8:11), c(.2, .4, .6, .8)) #' # extra quantiles are appended -#' as.tibble(extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75))) +#' as_tibble(extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75))) extrapolate_quantiles <- function(x, probs, replace_na = TRUE, ...) { UseMethod("extrapolate_quantiles") } diff --git a/R/layer_point_from_distn.R b/R/layer_point_from_distn.R index 5af434892..5d293992f 100644 --- a/R/layer_point_from_distn.R +++ b/R/layer_point_from_distn.R @@ -78,10 +78,10 @@ layer_point_from_distn_new <- function(type, name, id) { slather.layer_point_from_distn <- function(object, components, workflow, new_data, ...) { dstn <- components$predictions$.pred - if (!inherits(dstn, "distribution")) { - rlang::warn( + if (!(inherits(dstn, "quantile_pred") | inherits(dstn, "distribution"))) { + cli_warn( c("`layer_point_from_distn` requires distributional predictions.", - i = "These are of class {class(dstn)}. Ignoring this layer." + i = "These are of class {.cls {class(dstn)}}. Ignoring this layer." ) ) return(components) diff --git a/R/layer_threshold_preds.R b/R/layer_threshold_preds.R index c0903ffda..9acf06725 100644 --- a/R/layer_threshold_preds.R +++ b/R/layer_threshold_preds.R @@ -63,6 +63,7 @@ layer_threshold_new <- # restrict various objects to the interval [lower, upper] #' @export +#' @keywords internal snap <- function(x, lower, upper, ...) { UseMethod("snap") } diff --git a/R/pivot_quantiles.R b/R/pivot_quantiles.R index 37f08b46f..8e846d7e6 100644 --- a/R/pivot_quantiles.R +++ b/R/pivot_quantiles.R @@ -1,3 +1,53 @@ +#' Turn a vector of quantile distributions into a list-col +#' +#' `r lifecycle::badge("deprecated")` +#' +#' This function is deprecated. The recommended alternative is +#' [hardhat::quantile_pred()] with [tibble::as_tibble()] + +#' +#' @param x a `distribution` containing `dist_quantiles` +#' +#' @return a list-col +#' @export +#' +#' @examples +#' .pred_quantile <- quantile_pred(matrix(rnorm(20), 5), c(.2, .4, .6, .8)) +#' nested_quantiles(.pred_quantile) +#' +#' .pred_quantile %>% +#' as_tibble() %>% +#' tidyr::nest(.by = .row) %>% +#' dplyr::select(-.row) +#' +nested_quantiles <- function(x) { + lifecycle::deprecate_warn("0.1.11", "nested_quantiles()", "hardhat::quantile_pred()") + if (inherits(x, "distribution")) { + if (requireNamespace("distributional")) { + x <- vctrs::vec_data(x) + return(distributional:::dist_apply(x, .f = function(z) { + as_tibble(vctrs::vec_data(z)) %>% + mutate(across(everything(), as.double)) %>% + vctrs::list_of() + })) + } else { + cli_abort(c( + "`nested_quantiles()` is deprecated and the {.pkg distributional}", + `!` = "package is not installed.", + i = "See {.fn hardhat::quantile_pred}." + )) + } + } + if (inherits(x, "quantile_pred")) { + return(x %>% as_tibble() %>% tidyr::nest(.by = .row) %>% + dplyr::select(data)) + } + cli_abort(c( + "`nested_quantiles()` is deprecated. See {.fn hardhat::quantile_pred}." + )) +} + + #' Pivot a column containing `quantile_pred` longer #' #' A column that contains `quantile_pred` will be "lengthened" with diff --git a/R/quantile_pred-methods.R b/R/quantile_pred-methods.R index 75c2da70c..134308da2 100644 --- a/R/quantile_pred-methods.R +++ b/R/quantile_pred-methods.R @@ -1,3 +1,40 @@ +#' A distribution parameterized by a set of quantiles +#' +#' `r lifecycle::badge("deprecated")` +#' +#' This function is deprecated. The recommended alternative is +#' [hardhat::quantile_pred()]. +#' +#' @param values A vector (or list of vectors) of values. +#' @param quantile_levels A vector (or list of vectors) of probabilities +#' corresponding to `values`. +#' +#' When creating multiple sets of `values`/`quantile_levels` resulting in +#' different distributions, the sizes must match. See the examples below. +#' +#' @return A vector of class `"distribution"`. +#' +#' @export +#' @keywords internal +#' +#' @importFrom vctrs as_list_of vec_recycle_common new_vctr +dist_quantiles <- function(values, quantile_levels) { + lifecycle::deprecate_warn("0.1.11", "dist_quantiles()", "hardhat::quantile_pred()") + if (is.list(values)) { + n <- length(values) + values <- unlist(values) + return(quantile_pred(matrix(values, nrow = n, byrow = TRUE), quantile_levels)) + } else if (is.matrix(values)) { + return(quantile_pred(values, quantile_levels)) + } else if (is.vector(values)) { + return(quantile_pred(matrix(values, nrow = 1), quantile_levels)) + } + cli_abort(c( + "`dist_quantiles()` is deprecated and the format of `values` could not", + `!` = "be automatically converted to work with the replacement.", + i = "See {.fn hardhat::quantile_pred}." + )) +} # placeholder to avoid errors, but not ideal #' @importFrom hardhat quantile_pred @@ -6,6 +43,74 @@ mean.quantile_pred <- function(x, na.rm = FALSE, ...) { median(x, ...) } +# These next 3 functions should probably be added via PR to {hardhat} +# Only the third is actually *needed* at the moment. +# The second doesn't work correctly (not sure why), but leaving here for the +# future. +# +# We only export the third. +# +# self-self method, should work only if attr(quantile_levels) are compatible +# #' @importFrom vctrs vec_ptype2 vec_cast +# #' @importFrom hardhat extract_quantile_levels +# #' @export +# #' @keywords internal +# vec_ptype2.quantile_pred.quantile_pred <- function( +# x, y, ..., x_arg = "", y_arg = "", call = caller_env() +# ) { +# if (all(extract_quantile_levels(y) %in% extract_quantile_levels(x))) { +# return(x) +# } +# if (all(extract_quantile_levels(x) %in% extract_quantile_levels(y))) { +# return(y) +# } +# vctrs::stop_incompatible_type( +# x, y, x_arg = x_arg, y_arg = y_arg, +# details = "`quantile_levels` must be compatible (a superset/subset relation)." +# ) +# } + +# currently doesn't work +# #' @export +# vec_cast.quantile_pred.quantile_pred <- function( +# x, to, ..., x_arg = caller_arg(x), to_arg = caller_arg(to), +# call = caller_env() +# ) { +# to_ql <- extract_quantile_levels(to) +# x_ql <- extract_quantile_levels(x) +# x_in_to <- x_ql %in% to_ql +# to_in_x <- to_ql %in% x_ql +# if (all(x_in_to)) { +# mat <- matrix(NA, ncol = length(to_ql)) +# mat[ , to_in_x] <- c(as.matrix(x)) +# } else if (all(to_in_x)) { +# mat <- as.matrix(x)[ , x_in_to, drop = FALSE] +# } else { +# vctrs::stop_incompatible_type( +# x, to, x_arg = x_arg, y_arg = to_arg, +# details = "`quantile_levels` must be compatible (a superset/subset relation)." +# ) +# } +# quantile_pred(mat, to_ql) +# } + + +# Convert the quantile_pred to a data frame (named with the .quantile_levels) +# This powers vec_proxy_equal (and hence ==, !=, is.na, etc) +# It also powers vec_proxy_compare, so, given matching colnames, these should +# work out of the box. +# +#' @importFrom vctrs vec_proxy_equal +#' @export +vec_proxy_equal.quantile_pred <- function(x, ...) { + as_tibble(x) %>% + tidyr::pivot_wider( + names_from = .quantile_levels, + values_from = .pred_quantile + ) %>% + dplyr::select(-.row) +} + # quantiles by treating quantile_pred like a distribution ----------------- diff --git a/R/reexports-tidymodels.R b/R/reexports-tidymodels.R new file mode 100644 index 000000000..00cd7e4fd --- /dev/null +++ b/R/reexports-tidymodels.R @@ -0,0 +1,37 @@ +#' @importFrom generics fit +#' @export +generics::fit + +#' @importFrom generics forecast +#' @export +generics::forecast + +#' @importFrom recipes prep +#' @export +recipes::prep + +#' @importFrom recipes bake +#' @export +recipes::bake + +#' @importFrom recipes rand_id +#' @export +recipes::rand_id + +#' @importFrom tibble tibble as_tibble +#' @export +tibble::tibble + +#' @export +tibble::as_tibble + +#' @importFrom generics tidy +#' @export +generics::tidy + +#' @importFrom hardhat quantile_pred extract_quantile_levels +#' @export +hardhat::quantile_pred + +#' @export +hardhat::extract_quantile_levels diff --git a/R/utils-misc.R b/R/utils-misc.R index fec707913..bdb35a9eb 100644 --- a/R/utils-misc.R +++ b/R/utils-misc.R @@ -47,7 +47,7 @@ format_varnames <- function(x, empty = "*none*") { if (length(x) == 0L) { empty } else { - as.character(syms(x)) + as.character(rlang::syms(x)) } } diff --git a/man/dist_quantiles.Rd b/man/dist_quantiles.Rd new file mode 100644 index 000000000..1bfa437b0 --- /dev/null +++ b/man/dist_quantiles.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/quantile_pred-methods.R +\name{dist_quantiles} +\alias{dist_quantiles} +\title{A distribution parameterized by a set of quantiles} +\usage{ +dist_quantiles(values, quantile_levels) +} +\arguments{ +\item{values}{A vector (or list of vectors) of values.} + +\item{quantile_levels}{A vector (or list of vectors) of probabilities +corresponding to \code{values}. + +When creating multiple sets of \code{values}/\code{quantile_levels} resulting in +different distributions, the sizes must match. See the examples below.} +} +\value{ +A vector of class \code{"distribution"}. +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} +} +\details{ +This function is deprecated. The recommended alternative is +\code{\link[hardhat:quantile_pred]{hardhat::quantile_pred()}}. +} +\keyword{internal} diff --git a/man/extrapolate_quantiles.Rd b/man/extrapolate_quantiles.Rd index b645b85fa..bd460dbe9 100644 --- a/man/extrapolate_quantiles.Rd +++ b/man/extrapolate_quantiles.Rd @@ -29,7 +29,7 @@ similar to \code{\link[stats:quantile]{stats::quantile()}}, then \code{quantile( appropriate. } \examples{ -dstn <- quantile_dstn(rbind(1:4, 8:11), c(.2, .4, .6, .8)) +dstn <- quantile_pred(rbind(1:4, 8:11), c(.2, .4, .6, .8)) # extra quantiles are appended -as.tibble(extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75))) +as_tibble(extrapolate_quantiles(dstn, probs = c(.25, 0.5, .75))) } diff --git a/man/nested_quantiles.Rd b/man/nested_quantiles.Rd new file mode 100644 index 000000000..4b666ee32 --- /dev/null +++ b/man/nested_quantiles.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/pivot_quantiles.R +\name{nested_quantiles} +\alias{nested_quantiles} +\title{Turn a vector of quantile distributions into a list-col} +\usage{ +nested_quantiles(x) +} +\arguments{ +\item{x}{a \code{distribution} containing \code{dist_quantiles}} +} +\value{ +a list-col +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} +} +\details{ +This function is deprecated. The recommended alternative is +\code{\link[hardhat:quantile_pred]{hardhat::quantile_pred()}} with \code{\link[tibble:as_tibble]{tibble::as_tibble()}} +} +\examples{ +.pred_quantile <- quantile_pred(matrix(rnorm(20), 5), c(.2, .4, .6, .8)) +nested_quantiles(.pred_quantile) + +.pred_quantile \%>\% + as_tibble() \%>\% + tidyr::nest(.by = .row) \%>\% + dplyr::select(-.row) + +} diff --git a/man/reexports.Rd b/man/reexports.Rd index aedd9e46b..ab2cf17be 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -21,6 +21,10 @@ \alias{pivot_longer} \alias{pivot_wider} \alias{unnest} +\alias{as_tibble} +\alias{tidy} +\alias{quantile_pred} +\alias{extract_quantile_levels} \title{Objects exported from other packages} \keyword{internal} \description{ @@ -36,10 +40,11 @@ below to see their documentation. \item{ggplot2}{\code{\link[ggplot2]{autoplot}}} + \item{hardhat}{\code{\link[hardhat:quantile_pred]{extract_quantile_levels}}, \code{\link[hardhat]{quantile_pred}}} + \item{recipes}{\code{\link[recipes]{bake}}, \code{\link[recipes]{prep}}, \code{\link[recipes]{rand_id}}} \item{tibble}{\code{\link[tibble]{as_tibble}}, \code{\link[tibble]{tibble}}} \item{tidyr}{\code{\link[tidyr]{pivot_longer}}, \code{\link[tidyr]{pivot_wider}}, \code{\link[tidyr]{unnest}}} }} - diff --git a/tests/testthat/_snaps/dist_quantiles.md b/tests/testthat/_snaps/dist_quantiles.md deleted file mode 100644 index 1d626e089..000000000 --- a/tests/testthat/_snaps/dist_quantiles.md +++ /dev/null @@ -1,56 +0,0 @@ -# constructor returns reasonable quantiles - - Code - new_quantiles(rnorm(5), c(-2, -1, 0, 1, 2)) - Condition - Error in `new_quantiles()`: - ! `quantile_levels` must lie in [0, 1]. - ---- - - Code - new_quantiles(sort(rnorm(5)), sort(runif(2))) - Condition - Error in `new_quantiles()`: - ! length(values) == length(quantile_levels) is not TRUE - ---- - - Code - new_quantiles(c(2, 1, 3, 4, 5), c(0.1, 0.1, 0.2, 0.5, 0.8)) - Condition - Error in `new_quantiles()`: - ! !vctrs::vec_duplicate_any(quantile_levels) is not TRUE - ---- - - Code - new_quantiles(c(2, 1, 3, 4, 5), c(0.1, 0.15, 0.2, 0.5, 0.8)) - Condition - Error in `new_quantiles()`: - ! `values[order(quantile_levels)]` produces unsorted quantiles. - ---- - - Code - new_quantiles(c(1, 2, 3), c(0.1, 0.2, 3)) - Condition - Error in `new_quantiles()`: - ! `quantile_levels` must lie in [0, 1]. - -# arithmetic works on quantiles - - Code - sum(dstn) - Condition - Error in `mapply()`: - ! You can't perform arithmetic between two distributions like this. - ---- - - Code - suppressWarnings(dstn + distributional::dist_normal()) - Condition - Error: - ! non-numeric argument to binary operator - diff --git a/tests/testthat/_snaps/pivot_quantiles.md b/tests/testthat/_snaps/pivot_quantiles.md index 13dd81916..ea027d50c 100644 --- a/tests/testthat/_snaps/pivot_quantiles.md +++ b/tests/testthat/_snaps/pivot_quantiles.md @@ -38,3 +38,21 @@ Error in `pivot_quantiles_longer()`: ! Only one column can be pivotted. Can not pivot all of: `d1` and `d2`. +# nested_quantiles is deprecated, but works where possible + + Code + d <- dist_quantiles(list(1:4, 2:5), 1:4 / 5) + Condition + Warning: + `dist_quantiles()` was deprecated in epipredict 0.1.11. + i Please use `hardhat::quantile_pred()` instead. + +--- + + Code + o <- nested_quantiles(d) + Condition + Warning: + `nested_quantiles()` was deprecated in epipredict 0.1.11. + i Please use `hardhat::quantile_pred()` instead. + diff --git a/tests/testthat/_snaps/snapshots.md b/tests/testthat/_snaps/snapshots.md index 855cbb457..78f629171 100644 --- a/tests/testthat/_snaps/snapshots.md +++ b/tests/testthat/_snaps/snapshots.md @@ -2,30 +2,16 @@ structure(list(geo_value = c("ca", "fl", "ga", "ny", "pa", "tx" ), .pred = c(0.1393442, 0.103199, 0.3121244, 0.4218461, 0.7319844, - 0.1975426), .pred_distn = structure(list(structure(list(values = c(0, - 0.00989957999999999, 0.09353595, 0.1393442, 0.18515245, 0.26878882, - 0.34820911), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0.05739075, 0.103199, - 0.14900725, 0.23264362, 0.31206391), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.10325949, 0.18267978, 0.26631615, 0.3121244, - 0.35793265, 0.44156902, 0.52098931), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.21298119, 0.29240148, 0.37603785, 0.4218461, - 0.46765435, 0.55129072, 0.63071101), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.52311949, 0.60253978, 0.68617615, 0.7319844, - 0.77779265, 0.86142902, 0.94084931), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0.06809798, 0.15173435, 0.1975426, 0.24335085, - 0.32698722, 0.40640751), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr"))), class = c("distribution", "vctrs_vctr", + 0.1975426), .pred_distn = structure(list(c(0, 0.00989957999999999, + 0.09353595, 0.1393442, 0.18515245, 0.26878882, 0.34820911), c(0, + 0, 0.05739075, 0.103199, 0.14900725, 0.23264362, 0.31206391), + c(0.10325949, 0.18267978, 0.26631615, 0.3121244, 0.35793265, + 0.44156902, 0.52098931), c(0.21298119, 0.29240148, 0.37603785, + 0.4218461, 0.46765435, 0.55129072, 0.63071101), c(0.52311949, + 0.60253978, 0.68617615, 0.7319844, 0.77779265, 0.86142902, + 0.94084931), c(0, 0.06809798, 0.15173435, 0.1975426, 0.24335085, + 0.32698722, 0.40640751)), quantile_levels = c(0.05, 0.1, + 0.25, 0.5, 0.75, 0.9, 0.95), class = c("quantile_pred", "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, 18992, 18992, 18992, 18992), class = "Date"), target_date = structure(c(18999, 18999, 18999, 18999, 18999, 18999), class = "Date")), row.names = c(NA, @@ -35,31 +21,18 @@ structure(list(geo_value = c("ca", "fl", "ga", "ny", "pa", "tx" ), .pred = c(0.1393442, 0.103199, 0.3121244, 0.4218461, 0.7319844, - 0.1975426), .pred_distn = structure(list(structure(list(values = c(0.084583345, - 0.1073314, 0.1292864, 0.1393442, 0.149402, 0.171357, 0.194105055 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.048438145, 0.0711862, 0.0931412, 0.103199, 0.1132568, - 0.1352118, 0.157959855), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0.257363545, - 0.2801116, 0.3020666, 0.3121244, 0.3221822, 0.3441372, 0.366885255 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.367085245, 0.3898333, 0.4117883, 0.4218461, - 0.4319039, 0.4538589, 0.476606955), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.677223545, 0.6999716, 0.7219266, 0.7319844, - 0.7420422, 0.7639972, 0.786745255), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.142781745, 0.1655298, 0.1874848, 0.1975426, - 0.2076004, 0.2295554, 0.252303455), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr"))), class = c("distribution", - "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, - 18992, 18992, 18992, 18992), class = "Date"), target_date = structure(c(18993, + 0.1975426), .pred_distn = structure(list(c(0.084583345, 0.1073314, + 0.1292864, 0.1393442, 0.149402, 0.171357, 0.194105055), c(0.048438145, + 0.0711862, 0.0931412, 0.103199, 0.1132568, 0.1352118, 0.157959855 + ), c(0.257363545, 0.2801116, 0.3020666, 0.3121244, 0.3221822, + 0.3441372, 0.366885255), c(0.367085245, 0.3898333, 0.4117883, + 0.4218461, 0.4319039, 0.4538589, 0.476606955), c(0.677223545, + 0.6999716, 0.7219266, 0.7319844, 0.7420422, 0.7639972, 0.786745255 + ), c(0.142781745, 0.1655298, 0.1874848, 0.1975426, 0.2076004, + 0.2295554, 0.252303455)), quantile_levels = c(0.05, 0.1, 0.25, + 0.5, 0.75, 0.9, 0.95), class = c("quantile_pred", "vctrs_vctr", + "list")), forecast_date = structure(c(18992, 18992, 18992, 18992, + 18992, 18992), class = "Date"), target_date = structure(c(18993, 18993, 18993, 18993, 18993, 18993), class = "Date")), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame")) @@ -67,30 +40,16 @@ structure(list(geo_value = c("ca", "fl", "ga", "ny", "pa", "tx" ), .pred = c(0.1393442, 0.103199, 0.3121244, 0.4218461, 0.7319844, - 0.1975426), .pred_distn = structure(list(structure(list(values = c(0, - 0.00989957999999999, 0.09353595, 0.1393442, 0.18515245, 0.26878882, - 0.34820911), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0.05739075, 0.103199, - 0.14900725, 0.23264362, 0.31206391), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.10325949, 0.18267978, 0.26631615, 0.3121244, - 0.35793265, 0.44156902, 0.52098931), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.21298119, 0.29240148, 0.37603785, 0.4218461, - 0.46765435, 0.55129072, 0.63071101), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.52311949, 0.60253978, 0.68617615, 0.7319844, - 0.77779265, 0.86142902, 0.94084931), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0.06809798, 0.15173435, 0.1975426, 0.24335085, - 0.32698722, 0.40640751), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr"))), class = c("distribution", "vctrs_vctr", + 0.1975426), .pred_distn = structure(list(c(0, 0.00989957999999999, + 0.09353595, 0.1393442, 0.18515245, 0.26878882, 0.34820911), c(0, + 0, 0.05739075, 0.103199, 0.14900725, 0.23264362, 0.31206391), + c(0.10325949, 0.18267978, 0.26631615, 0.3121244, 0.35793265, + 0.44156902, 0.52098931), c(0.21298119, 0.29240148, 0.37603785, + 0.4218461, 0.46765435, 0.55129072, 0.63071101), c(0.52311949, + 0.60253978, 0.68617615, 0.7319844, 0.77779265, 0.86142902, + 0.94084931), c(0, 0.06809798, 0.15173435, 0.1975426, 0.24335085, + 0.32698722, 0.40640751)), quantile_levels = c(0.05, 0.1, + 0.25, 0.5, 0.75, 0.9, 0.95), class = c("quantile_pred", "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, 18992, 18992, 18992, 18992), class = "Date"), target_date = structure(c(18999, 18999, 18999, 18999, 18999, 18999), class = "Date")), row.names = c(NA, @@ -100,30 +59,16 @@ structure(list(geo_value = c("ca", "fl", "ga", "ny", "pa", "tx" ), .pred = c(0.1393442, 0.103199, 0.3121244, 0.4218461, 0.7319844, - 0.1975426), .pred_distn = structure(list(structure(list(values = c(0, - 0.00989957999999999, 0.09353595, 0.1393442, 0.18515245, 0.26878882, - 0.34820911), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0.05739075, 0.103199, - 0.14900725, 0.23264362, 0.31206391), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.10325949, 0.18267978, 0.26631615, 0.3121244, - 0.35793265, 0.44156902, 0.52098931), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.21298119, 0.29240148, 0.37603785, 0.4218461, - 0.46765435, 0.55129072, 0.63071101), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.52311949, 0.60253978, 0.68617615, 0.7319844, - 0.77779265, 0.86142902, 0.94084931), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0.06809798, 0.15173435, 0.1975426, 0.24335085, - 0.32698722, 0.40640751), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr"))), class = c("distribution", "vctrs_vctr", + 0.1975426), .pred_distn = structure(list(c(0, 0.00989957999999999, + 0.09353595, 0.1393442, 0.18515245, 0.26878882, 0.34820911), c(0, + 0, 0.05739075, 0.103199, 0.14900725, 0.23264362, 0.31206391), + c(0.10325949, 0.18267978, 0.26631615, 0.3121244, 0.35793265, + 0.44156902, 0.52098931), c(0.21298119, 0.29240148, 0.37603785, + 0.4218461, 0.46765435, 0.55129072, 0.63071101), c(0.52311949, + 0.60253978, 0.68617615, 0.7319844, 0.77779265, 0.86142902, + 0.94084931), c(0, 0.06809798, 0.15173435, 0.1975426, 0.24335085, + 0.32698722, 0.40640751)), quantile_levels = c(0.05, 0.1, + 0.25, 0.5, 0.75, 0.9, 0.95), class = c("quantile_pred", "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, 18992, 18992, 18992, 18992), class = "Date"), target_date = structure(c(18993, 18993, 18993, 18993, 18993, 18993), class = "Date")), row.names = c(NA, @@ -141,279 +86,160 @@ 0.7319844, 0.7319844, 0.7319844, 0.1975426, 0.1975426, 0.1975426, 0.1975426, 0.1975426), ahead = c(1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, - 4L, 5L, 1L, 2L, 3L, 4L, 5L), .pred_distn = structure(list(structure(list( - values = c(0, 0, 0, 0.05519342, 0.082372705, 0.0936219, 0.1048711, - 0.1157573, 0.12317806, 0.1302723, 0.1353526, 0.1393442, 0.1433358, - 0.1484161, 0.15551034, 0.1629311, 0.1738173, 0.1850665, 0.196315695, - 0.22349498, 0.309768685, 0.3567520625, 0.439580229), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0.0335550493877939, + 4L, 5L, 1L, 2L, 3L, 4L, 5L), .pred_distn = structure(list(c(0, + 0, 0, 0.05519342, 0.082372705, 0.0936219, 0.1048711, 0.1157573, + 0.12317806, 0.1302723, 0.1353526, 0.1393442, 0.1433358, 0.1484161, + 0.15551034, 0.1629311, 0.1738173, 0.1850665, 0.196315695, 0.22349498, + 0.309768685, 0.3567520625, 0.439580229), c(0, 0, 0, 0, 0.0335550493877939, 0.0604073208819088, 0.0796881899581496, 0.0945180888333883, 0.107218788833388, 0.118830788833388, 0.129717088833388, 0.1393442, 0.148949488833388, 0.159110072060821, 0.171080110623306, 0.184009705322953, 0.19866346102411, 0.218798896615666, 0.250961850618106, 0.300471354816148, 0.368582781136862, - 0.43909595699107, 0.520101234797705), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0.0310685196688967, + 0.43909595699107, 0.520101234797705), c(0, 0, 0, 0, 0, 0.0310685196688967, 0.0565901050435504, 0.0768417663716637, 0.0947104815343153, 0.110553706525765, 0.125192081534315, 0.1393442, 0.153133424194392, 0.167807181271713, 0.183769310145952, 0.202099979390294, 0.224139947221972, 0.252840918770688, 0.291417895572206, 0.341073550318203, 0.420604597710477, 0.494523225410904, - 0.573647294116801), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0.00623643594225938, 0.0360877950479505, - 0.0604332430739307, 0.0824028153516535, 0.102509343235732, - 0.121439405653606, 0.1393442, 0.15780837904264, 0.176333479766098, - 0.1971089199637, 0.219859545844459, 0.246500872561225, 0.279163385675357, - 0.320379296602716, 0.374497727839579, 0.458894379633346, - 0.535545067037845, 0.628776504364044), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0, 0.0192048017017668, - 0.0478501821296211, 0.0723167026720766, 0.0958385084225842, 0.11812331897399, - 0.1393442, 0.161074539705197, 0.184026763327133, 0.207844848454635, - 0.23407004803228, 0.265166265836908, 0.302137478236883, 0.346008752873429, - 0.403205598400084, 0.495260096430714, 0.574198142463125, 0.672941852619816 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, - 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 0, - 0, 0, 0.016465765, 0.03549514, 0.05225675, 0.0644172, 0.0749343000000001, + 0.573647294116801), c(0, 0, 0, 0, 0, 0.00623643594225938, 0.0360877950479505, + 0.0604332430739307, 0.0824028153516535, 0.102509343235732, 0.121439405653606, + 0.1393442, 0.15780837904264, 0.176333479766098, 0.1971089199637, + 0.219859545844459, 0.246500872561225, 0.279163385675357, 0.320379296602716, + 0.374497727839579, 0.458894379633346, 0.535545067037845, 0.628776504364044 + ), c(0, 0, 0, 0, 0, 0, 0.0192048017017668, 0.0478501821296211, + 0.0723167026720766, 0.0958385084225842, 0.11812331897399, 0.1393442, + 0.161074539705197, 0.184026763327133, 0.207844848454635, 0.23407004803228, + 0.265166265836908, 0.302137478236883, 0.346008752873429, 0.403205598400084, + 0.495260096430714, 0.574198142463125, 0.672941852619816), c(0, + 0, 0, 0, 0.016465765, 0.03549514, 0.05225675, 0.0644172, 0.0749343, 0.0847941, 0.0966258, 0.103199, 0.1097722, 0.1216039, 0.1314637, 0.1419808, 0.15414125, 0.17090286, 0.189932235, 0.22848398, 0.30542311, - 0.40216399, 0.512353658), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0.00331296053340532, 0.0234804643776438, - 0.0414109089650896, 0.0579040140087902, 0.0738391473860739, - 0.0882882738549385, 0.103199, 0.118522737211872, 0.134217143129031, - 0.15174910202592, 0.17076597900759, 0.192368859892349, 0.218887, - 0.254338497855279, 0.307871753369934, 0.407530532639726, - 0.506824682189646, 0.607973477267732), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0, 0, - 0.0185864520320203, 0.0411215858914089, 0.062281046686267, 0.0828222124563246, - 0.103199, 0.123575888447284, 0.144785989158292, 0.167277039342293, - 0.192536265178252, 0.221677797769728, 0.256887836856768, 0.302366681512415, - 0.3669383199518, 0.476508917333523, 0.574293059865274, 0.69194511433946 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, - 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 0, - 0, 0, 0, 0, 0, 0, 0.0271019287070871, 0.0535555494987951, 0.0785514374097741, - 0.103199, 0.128043832742677, 0.154157375592856, 0.181874602598776, - 0.212708648669987, 0.247608381738568, 0.289082621291513, 0.342486159511745, - 0.41300665395314, 0.52870334697862, 0.634316186092986, 0.767614547228429 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, - 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 0, - 0, 0, 0, 0, 0, 0, 0.0118725894981448, 0.0439446210512103, 0.0736366703227029, - 0.103199, 0.133138617710077, 0.16357656105121, 0.19575459701827, - 0.230475760859608, 0.269323345322203, 0.314976554734947, 0.373424338576786, - 0.452807955824158, 0.578141866759416, 0.690542571738594, 0.837295153768033 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, - 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 0, - 0.0813658, 0.14899276, 0.1960782, 0.22542314, 0.2414296, 0.25890318, - 0.2747762, 0.2881148, 0.3027873, 0.3121244, 0.3214615, 0.336134, - 0.3494726, 0.36534562, 0.3828192, 0.39882566, 0.4281706, 0.47525604, - 0.542883, 0.682805397499999, 0.798878314999999), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0.0706949, - 0.1267172, 0.1667331, 0.198582473624236, 0.225423180397104, 0.2494327, - 0.2707747, 0.292116312116921, 0.3121244, 0.3321324, 0.353072222341423, - 0.375089999249792, 0.3988256, 0.425831930221552, 0.459232792604326, - 0.501467782274773, 0.562188443556836, 0.685648485782108, 0.80647163752115, - 0.939224788489265), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0.0704696868359684, 0.121407167925079, - 0.161930580284053, 0.197682797539976, 0.228361656891269, - 0.257706650923509, 0.285717780926109, 0.3121244, 0.338115598498035, - 0.365749693067931, 0.395921877240673, 0.427437934626446, - 0.462388578749537, 0.504066064225642, 0.558443518811788, - 0.636013559040791, 0.771225883005179, 0.89210797204162, 1.02314875759509 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, - 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, - 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0.0247190015881658, 0.0834693973257732, - 0.131490031120311, 0.173258318827988, 0.211213742349423, - 0.246202447408474, 0.279926744217642, 0.3121244, 0.344908347408474, - 0.378255200773608, 0.412935547408474, 0.45191576510605, 0.494757615230152, - 0.545060918490786, 0.609312182129471, 0.69704881099591, 0.838550239412991, - 0.962653262246773, 1.11351403170759), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0.0501392705767058, - 0.104248897713977, 0.151994400390804, 0.195087767727627, 0.235544124698047, - 0.274058107118071, 0.3121244, 0.350571341810268, 0.390274666572666, - 0.43048632300908, 0.474320393891039, 0.523839613390634, 0.581010268149082, - 0.652137495469405, 0.748428674762348, 0.898563270096551, 1.03273295410124, - 1.19211145220822), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0.2148017, 0.31250597, 0.350183905, 0.3745639, - 0.3884161, 0.39746621, 0.404854, 0.4115031, 0.417413315, - 0.4218461, 0.426278885, 0.4321891, 0.4388382, 0.44622599, - 0.4552761, 0.4691283, 0.493508295, 0.53118623, 0.628890499999999, - 1.22043540499999, 1.95905017899999), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0.212369462232823, - 0.289571577546325, 0.324446887783878, 0.351262144469445, 0.37087, - 0.3863844, 0.399682509835098, 0.411036898891089, 0.4218461, 0.432927818676137, - 0.444338520819208, 0.4573077, 0.4728222, 0.492817749438994, 0.519442857224172, - 0.556165331447064, 0.635946057886079, 1.18402232252562, 1.7827032389242, - 2.5561261649726), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0.0413098183761837, 0.216633655848608, - 0.28006329699657, 0.3175577049983, 0.345923291761818, 0.368957399144641, - 0.38804556403724, 0.405400893204282, 0.4218461, 0.43864616004845, - 0.456105937661177, 0.475585378227632, 0.499018124730147, - 0.5270891900114, 0.564293444378844, 0.630730263388634, 0.898212235100651, - 1.53976520159876, 2.08228809477582, 2.80588762256078), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0.114729892920429, - 0.227785958288583, 0.282278878729037, 0.320407599201492, 0.350577823459785, - 0.376652303049231, 0.39981364198757, 0.4218461, 0.444009706175862, - 0.466962725214852, 0.493098379685547, 0.523708407392674, 0.562100740111401, - 0.619050517814778, 0.754868363055733, 1.1177263295869, 1.76277018354499, - 2.37278671910076, 2.9651652434047), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0.0100954501382014, - 0.165091099860099, 0.244964334392844, 0.294577054174442, 0.333357739419644, - 0.365251480804308, 0.394198909379894, 0.4218461, 0.449607812233022, - 0.479120513116631, 0.511271131674317, 0.5506402899964, 0.60295411796593, - 0.690751300611906, 0.913578722060166, 1.30856988553206, 1.94020220543606, - 2.57104934168037, 3.07139639379724), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.303454977, 0.3982330425, - 0.46791125, 0.57642367, 0.631462275, 0.6694025, 0.685048, 0.69857015, - 0.7085162, 0.71633898, 0.7252792, 0.7319844, 0.7386896, 0.74762982, - 0.7554526, 0.76539865, 0.7789208, 0.7945663, 0.832506525, 0.88754513, - 0.99605755, 1.0657357575, 1.160513823), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.188727136659627, - 0.292714653217782, 0.380882595473705, 0.476427609604196, 0.5464739, - 0.6001155, 0.636506664263643, 0.6638148, 0.684726301742618, 0.701811, - 0.7174565, 0.7319844, 0.7465124, 0.7621578, 0.779322149415794, - 0.800154, 0.826981204292293, 0.8649709, 0.918345662372574, 0.987315641681917, - 1.08210087899389, 1.17564510102166, 1.27428433325155), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.0928040444059739, - 0.212569233904214, 0.310718449102641, 0.418013562853928, 0.489917936424114, - 0.546885925424654, 0.593410228218282, 0.631406259421094, 0.661579628218282, - 0.687282906872069, 0.710456666258662, 0.7319844, 0.754131389282943, - 0.776685628218282, 0.802388976168662, 0.832758896293562, 0.869440928218282, - 0.916359694097141, 0.97403912794778, 1.04529048496565, 1.15710382277548, - 1.25675656404419, 1.37098330871205), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.0108404989744699, - 0.144337973117581, 0.250292371898569, 0.367310419323293, 0.44444044802193, - 0.506592035751958, 0.558428768125431, 0.602035095628756, 0.64112383905529, - 0.674354964141041, 0.703707875219752, 0.7319844, 0.760702196782168, - 0.789758264058441, 0.823427572594726, 0.860294897090771, 0.904032120658957, - 0.955736581115011, 1.0165945004053, 1.09529786576616, 1.21614421175967, - 1.32331604019295, 1.45293812780298), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0.0783919019408445, - 0.19440762901709, 0.323264916745368, 0.407999619319143, 0.474764568463685, - 0.530890671381964, 0.580852443909739, 0.623441748828038, 0.661393469870099, - 0.69827126098506, 0.7319844, 0.766440770218252, 0.802260162496625, - 0.840536805657307, 0.883133954556946, 0.931565607767828, 0.98815401699637, - 1.05406790404239, 1.138596250043, 1.27030064370239, 1.39007785503355, - 1.5343628053761), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0.012845105, 0.07040502, 0.09495188, 0.12669976, - 0.1502248, 0.1659163, 0.1761341, 0.18586528, 0.191290375, - 0.1975426, 0.203794825, 0.20921992, 0.2189511, 0.2291689, - 0.2448604, 0.26838544, 0.30013332, 0.32468018, 0.382240095, - 0.5020427625, 0.590302013999998), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0.0133856545472455, + 0.40216399, 0.512353658), c(0, 0, 0, 0, 0, 0.00331296053340532, + 0.0234804643776438, 0.0414109089650896, 0.0579040140087902, 0.0738391473860739, + 0.0882882738549385, 0.103199, 0.118522737211872, 0.134217143129031, + 0.15174910202592, 0.17076597900759, 0.192368859892349, 0.218887, + 0.254338497855279, 0.307871753369934, 0.407530532639726, 0.506824682189646, + 0.607973477267732), c(0, 0, 0, 0, 0, 0, 0, 0.0185864520320203, + 0.0411215858914089, 0.062281046686267, 0.0828222124563246, 0.103199, + 0.123575888447284, 0.144785989158292, 0.167277039342293, 0.192536265178252, + 0.221677797769728, 0.256887836856768, 0.302366681512415, 0.3669383199518, + 0.476508917333523, 0.574293059865274, 0.69194511433946), c(0, + 0, 0, 0, 0, 0, 0, 0, 0.0271019287070871, 0.0535555494987951, + 0.0785514374097741, 0.103199, 0.128043832742677, 0.154157375592856, + 0.181874602598776, 0.212708648669987, 0.247608381738568, 0.289082621291513, + 0.342486159511745, 0.41300665395314, 0.52870334697862, 0.634316186092986, + 0.767614547228429), c(0, 0, 0, 0, 0, 0, 0, 0, 0.0118725894981448, + 0.0439446210512103, 0.0736366703227029, 0.103199, 0.133138617710077, + 0.16357656105121, 0.19575459701827, 0.230475760859608, 0.269323345322203, + 0.314976554734947, 0.373424338576786, 0.452807955824158, 0.578141866759416, + 0.690542571738594, 0.837295153768033), c(0, 0, 0.0813658, 0.14899276, + 0.1960782, 0.22542314, 0.2414296, 0.25890318, 0.2747762, 0.2881148, + 0.3027873, 0.3121244, 0.3214615, 0.336134, 0.3494726, 0.36534562, + 0.3828192, 0.39882566, 0.4281706, 0.47525604, 0.542883, 0.682805397499999, + 0.798878314999999), c(0, 0, 0, 0.0706949, 0.1267172, 0.1667331, + 0.198582473624236, 0.225423180397104, 0.2494327, 0.2707747, 0.292116312116921, + 0.3121244, 0.3321324, 0.353072222341423, 0.375089999249792, 0.3988256, + 0.425831930221552, 0.459232792604326, 0.501467782274773, 0.562188443556836, + 0.685648485782108, 0.80647163752115, 0.939224788489265), c(0, + 0, 0, 0, 0.0704696868359684, 0.121407167925079, 0.161930580284053, + 0.197682797539976, 0.228361656891269, 0.257706650923509, 0.285717780926109, + 0.3121244, 0.338115598498035, 0.365749693067931, 0.395921877240673, + 0.427437934626446, 0.462388578749537, 0.504066064225642, 0.558443518811788, + 0.636013559040791, 0.771225883005179, 0.89210797204162, 1.02314875759509 + ), c(0, 0, 0, 0, 0.0247190015881658, 0.0834693973257732, 0.131490031120311, + 0.173258318827988, 0.211213742349423, 0.246202447408474, 0.279926744217642, + 0.3121244, 0.344908347408474, 0.378255200773608, 0.412935547408474, + 0.45191576510605, 0.494757615230152, 0.545060918490786, 0.609312182129471, + 0.69704881099591, 0.838550239412991, 0.962653262246773, 1.11351403170759 + ), c(0, 0, 0, 0, 0, 0.0501392705767058, 0.104248897713977, 0.151994400390804, + 0.195087767727627, 0.235544124698047, 0.274058107118071, 0.3121244, + 0.350571341810268, 0.390274666572666, 0.43048632300908, 0.474320393891039, + 0.523839613390634, 0.581010268149082, 0.652137495469405, 0.748428674762348, + 0.898563270096551, 1.03273295410124, 1.19211145220822), c(0, + 0, 0.2148017, 0.31250597, 0.350183905, 0.3745639, 0.3884161, + 0.39746621, 0.404854, 0.4115031, 0.417413315, 0.4218461, 0.426278885, + 0.4321891, 0.4388382, 0.44622599, 0.4552761, 0.4691283, 0.493508295, + 0.53118623, 0.628890499999999, 1.22043540499999, 1.95905017899999 + ), c(0, 0, 0, 0.212369462232823, 0.289571577546325, 0.324446887783878, + 0.351262144469445, 0.37087, 0.3863844, 0.399682509835098, 0.411036898891089, + 0.4218461, 0.432927818676137, 0.444338520819208, 0.4573077, 0.4728222, + 0.492817749438994, 0.519442857224172, 0.556165331447064, 0.635946057886079, + 1.18402232252562, 1.7827032389242, 2.5561261649726), c(0, 0, + 0, 0.0413098183761837, 0.216633655848608, 0.28006329699657, 0.3175577049983, + 0.345923291761818, 0.368957399144641, 0.38804556403724, 0.405400893204282, + 0.4218461, 0.43864616004845, 0.456105937661177, 0.475585378227632, + 0.499018124730147, 0.5270891900114, 0.564293444378844, 0.630730263388634, + 0.898212235100651, 1.53976520159876, 2.08228809477582, 2.80588762256078 + ), c(0, 0, 0, 0, 0.114729892920429, 0.227785958288583, 0.282278878729037, + 0.320407599201492, 0.350577823459785, 0.37665230304923, 0.39981364198757, + 0.4218461, 0.444009706175862, 0.466962725214852, 0.493098379685547, + 0.523708407392674, 0.562100740111401, 0.619050517814778, 0.754868363055733, + 1.1177263295869, 1.76277018354499, 2.37278671910076, 2.9651652434047 + ), c(0, 0, 0, 0, 0.0100954501382014, 0.165091099860099, 0.244964334392844, + 0.294577054174442, 0.333357739419644, 0.365251480804308, 0.394198909379894, + 0.4218461, 0.449607812233022, 0.479120513116631, 0.511271131674317, + 0.5506402899964, 0.60295411796593, 0.690751300611906, 0.913578722060166, + 1.30856988553206, 1.94020220543606, 2.57104934168037, 3.07139639379724 + ), c(0.303454977, 0.3982330425, 0.46791125, 0.57642367, 0.631462275, + 0.6694025, 0.685048, 0.69857015, 0.7085162, 0.71633898, 0.7252792, + 0.7319844, 0.7386896, 0.74762982, 0.7554526, 0.76539865, 0.7789208, + 0.7945663, 0.832506525, 0.88754513, 0.99605755, 1.0657357575, + 1.160513823), c(0.188727136659627, 0.292714653217782, 0.380882595473705, + 0.476427609604196, 0.5464739, 0.6001155, 0.636506664263643, 0.6638148, + 0.684726301742618, 0.701811, 0.7174565, 0.7319844, 0.7465124, + 0.7621578, 0.779322149415794, 0.800154, 0.826981204292293, 0.8649709, + 0.918345662372574, 0.987315641681917, 1.08210087899389, 1.17564510102166, + 1.27428433325155), c(0.0928040444059739, 0.212569233904214, 0.310718449102641, + 0.418013562853928, 0.489917936424114, 0.546885925424654, 0.593410228218282, + 0.631406259421094, 0.661579628218282, 0.687282906872069, 0.710456666258662, + 0.7319844, 0.754131389282943, 0.776685628218282, 0.802388976168662, + 0.832758896293562, 0.869440928218282, 0.916359694097141, 0.97403912794778, + 1.04529048496565, 1.15710382277548, 1.25675656404419, 1.37098330871205 + ), c(0.0108404989744699, 0.144337973117581, 0.250292371898569, + 0.367310419323293, 0.44444044802193, 0.506592035751958, 0.558428768125431, + 0.602035095628756, 0.64112383905529, 0.674354964141041, 0.703707875219752, + 0.7319844, 0.760702196782168, 0.78975826405844, 0.823427572594726, + 0.860294897090771, 0.904032120658957, 0.955736581115011, 1.0165945004053, + 1.09529786576616, 1.21614421175967, 1.32331604019295, 1.45293812780298 + ), c(0, 0.0783919019408445, 0.19440762901709, 0.323264916745368, + 0.407999619319143, 0.474764568463685, 0.530890671381964, 0.580852443909739, + 0.623441748828038, 0.661393469870099, 0.69827126098506, 0.7319844, + 0.766440770218252, 0.802260162496625, 0.840536805657307, 0.883133954556946, + 0.931565607767828, 0.98815401699637, 1.05406790404239, 1.138596250043, + 1.27030064370239, 1.39007785503355, 1.5343628053761), c(0, 0, + 0.012845105, 0.07040502, 0.09495188, 0.12669976, 0.1502248, 0.1659163, + 0.1761341, 0.18586528, 0.191290375, 0.1975426, 0.203794825, 0.20921992, + 0.2189511, 0.2291689, 0.2448604, 0.26838544, 0.30013332, 0.32468018, + 0.382240095, 0.5020427625, 0.590302013999998), c(0, 0, 0, 0.0133856545472455, 0.0528330564916649, 0.0825071163605637, 0.107217748074731, 0.130397558147181, 0.151367721571716, 0.1688357, 0.183736649076791, 0.1975426, 0.2111662, 0.226622576069161, 0.244738709634746, 0.265660771838618, 0.289502, 0.3157762, 0.347933515877459, 0.395446576674467, 0.494033943284933, - 0.586036939413118, 0.696507800090321), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0.0119984314577645, + 0.586036939413118, 0.696507800090321), c(0, 0, 0, 0, 0.0119984314577645, 0.0497573816250162, 0.081255049503995, 0.108502307388674, 0.132961558931189, 0.156011650575706, 0.177125892134071, 0.1975426, 0.217737120618906, 0.239458499211792, 0.263562581820818, 0.289525383565136, 0.31824420000725, - 0.351413051940519, 0.393862560773808, 0.453538799225292, 0.558631806850418, - 0.657452391363313, 0.767918764883928), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0.0189057930465303, + 0.35141305194052, 0.393862560773808, 0.453538799225292, 0.558631806850418, + 0.657452391363313, 0.767918764883928), c(0, 0, 0, 0, 0, 0.0189057930465303, 0.0558619823820737, 0.0885055048481483, 0.117823094349893, 0.145878789120691, 0.171852417645726, 0.1975426, 0.222526993865839, 0.249029206661066, 0.27731797305948, 0.306704680469104, 0.340659034209842, 0.379550761828618, 0.429562304567396, 0.499209921951019, 0.612206099576094, 0.713714149138691, - 0.835600324727346), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0, 0.0331956220262204, 0.0710455499705998, - 0.105140687231072, 0.136976315413355, 0.167518817907279, - 0.1975426, 0.226974062486675, 0.257640196272163, 0.289459502055271, - 0.323342029611596, 0.361500312536625, 0.407123841331413, - 0.46286764504675, 0.538379175655057, 0.659249503348734, 0.768470658367656, - 0.898774707571334), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr"))), class = c("distribution", - "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, + 0.835600324727346), c(0, 0, 0, 0, 0, 0, 0.0331956220262204, 0.0710455499705998, + 0.105140687231072, 0.136976315413355, 0.167518817907279, 0.1975426, + 0.226974062486675, 0.257640196272163, 0.289459502055271, 0.323342029611596, + 0.361500312536625, 0.407123841331413, 0.46286764504675, 0.538379175655057, + 0.659249503348734, 0.768470658367656, 0.898774707571334)), quantile_levels = c(0.01, + 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, + 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 + ), class = c("quantile_pred", "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, - 18992), class = "Date"), target_date = structure(c(18999, 19006, - 19013, 19020, 19027, 18999, 19006, 19013, 19020, 19027, 18999, + 18992, 18992), class = "Date"), target_date = structure(c(18999, 19006, 19013, 19020, 19027, 18999, 19006, 19013, 19020, 19027, 18999, 19006, 19013, 19020, 19027, 18999, 19006, 19013, 19020, - 19027), class = "Date")), row.names = c(NA, -30L), class = c("tbl_df", + 19027, 18999, 19006, 19013, 19020, 19027, 18999, 19006, 19013, + 19020, 19027), class = "Date")), row.names = c(NA, -30L), class = c("tbl_df", "tbl", "data.frame")) --- @@ -428,290 +254,167 @@ 0.7319844, 0.7319844, 0.7319844, 0.1975426, 0.1975426, 0.1975426, 0.1975426, 0.1975426), ahead = c(2L, 3L, 4L, 5L, 6L, 2L, 3L, 4L, 5L, 6L, 2L, 3L, 4L, 5L, 6L, 2L, 3L, 4L, 5L, 6L, 2L, 3L, 4L, - 5L, 6L, 2L, 3L, 4L, 5L, 6L), .pred_distn = structure(list(structure(list( - values = c(0, 0, 0, 0, 0.0344362435566855, 0.0610170086495865, - 0.0798865084778347, 0.0944014546310463, 0.107339121226462, - 0.11899734099851, 0.129600408649586, 0.1393442, 0.149195708649586, - 0.159627982246122, 0.170968308649587, 0.184031805880359, - 0.198909658094331, 0.219058736130861, 0.250692448549235, - 0.300646382944129, 0.368938143197633, 0.440038195052124, - 0.51997011826723), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0.0303364052628526, 0.0557306728227282, - 0.0766736159703596, 0.0942284381264812, 0.11050757203172, - 0.125214601455714, 0.1393442, 0.15359732398729, 0.168500447692877, - 0.184551468093631, 0.202926420944109, 0.22476606802393, 0.253070223293233, - 0.291229953951089, 0.341963643747938, 0.419747975311502, - 0.495994046054689, 0.5748791770223), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0.00603076915889168, - 0.0356039073625737, 0.0609470811194113, 0.0833232869645198, 0.103265350891109, - 0.121507077706427, 0.1393442, 0.157305073932789, 0.176004666813668, - 0.196866917086671, 0.219796529731897, 0.247137200365254, 0.280371254591746, - 0.320842872758278, 0.374783454750148, 0.461368597638526, 0.539683256474915, - 0.632562403391324), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0, 0.018869505399304, 0.0471517885822858, - 0.0732707765908659, 0.0969223475714758, 0.118188509171441, - 0.1393442, 0.161036861715017, 0.183255665579256, 0.207206810683007, - 0.23409988698267, 0.265549713886389, 0.302197074524145, 0.346715970732557, - 0.40460690801818, 0.498076490174802, 0.580016068409433, 0.680138975526255 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, - 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, - 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0, 0.00232218982614828, 0.0342017690820909, - 0.062828756299263, 0.0893725834453345, 0.114623710996309, - 0.1393442, 0.163790622390774, 0.189495107256772, 0.216754530328403, - 0.247065337260473, 0.281410456107061, 0.32037037400004, 0.367018829587046, - 0.431198706165962, 0.52829547296083, 0.619021148955337, 0.728730172315724 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, - 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, - 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0.00233673672776743, 0.0223488000000001, - 0.040304673503435, 0.0576262998104982, 0.0732741199141993, - 0.088455610793058, 0.103199, 0.118707592060121, 0.134185928864089, - 0.151183139276793, 0.1702454, 0.191937, 0.2182298, 0.253577609846549, - 0.307351538752588, 0.407165223924639, 0.502529513927214, - 0.605582108686126), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0, 0, 0.0190621000375005, 0.0420071558734088, - 0.0629230825705257, 0.0833688260410605, 0.103199, 0.124118509153392, - 0.145401945823358, 0.168667287877079, 0.1939090000375, 0.222597428173282, - 0.256984900377504, 0.301709122144422, 0.366495424858649, - 0.475152766217062, 0.572497835146252, 0.693762274318904), - quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, - 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0, 0, 0, 0.0269530072946728, 0.0530040092850928, - 0.0782481277003769, 0.103199, 0.12816325599641, 0.154866111682517, - 0.182302899107341, 0.213783044306043, 0.248363904708547, - 0.28995690796288, 0.341627908394784, 0.413707680386504, 0.528381820556805, - 0.635771182105746, 0.77652465912812), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0, 0, + 5L, 6L, 2L, 3L, 4L, 5L, 6L), .pred_distn = structure(list(c(0, + 0, 0, 0, 0.0344362435566855, 0.0610170086495865, 0.0798865084778347, + 0.0944014546310463, 0.107339121226462, 0.11899734099851, 0.129600408649586, + 0.1393442, 0.149195708649586, 0.159627982246122, 0.170968308649587, + 0.184031805880359, 0.198909658094331, 0.219058736130861, 0.250692448549235, + 0.300646382944129, 0.368938143197633, 0.440038195052124, 0.51997011826723 + ), c(0, 0, 0, 0, 0, 0.0303364052628526, 0.0557306728227282, 0.0766736159703596, + 0.0942284381264812, 0.11050757203172, 0.125214601455714, 0.1393442, + 0.15359732398729, 0.168500447692877, 0.184551468093631, 0.202926420944109, + 0.22476606802393, 0.253070223293233, 0.29122995395109, 0.341963643747938, + 0.419747975311502, 0.495994046054689, 0.5748791770223), c(0, + 0, 0, 0, 0, 0.00603076915889168, 0.0356039073625737, 0.0609470811194113, + 0.0833232869645198, 0.103265350891109, 0.121507077706427, 0.1393442, + 0.157305073932789, 0.176004666813668, 0.196866917086671, 0.219796529731897, + 0.247137200365254, 0.280371254591746, 0.320842872758278, 0.374783454750148, + 0.461368597638526, 0.539683256474915, 0.632562403391324), c(0, + 0, 0, 0, 0, 0, 0.018869505399304, 0.0471517885822858, 0.0732707765908659, + 0.0969223475714758, 0.118188509171441, 0.1393442, 0.161036861715017, + 0.183255665579256, 0.207206810683007, 0.23409988698267, 0.265549713886389, + 0.302197074524145, 0.346715970732557, 0.40460690801818, 0.498076490174802, + 0.580016068409433, 0.680138975526255), c(0, 0, 0, 0, 0, 0, 0.00232218982614828, + 0.0342017690820909, 0.062828756299263, 0.0893725834453345, 0.114623710996309, + 0.1393442, 0.163790622390774, 0.189495107256772, 0.216754530328403, + 0.247065337260473, 0.281410456107061, 0.32037037400004, 0.367018829587046, + 0.431198706165962, 0.52829547296083, 0.619021148955337, 0.728730172315724 + ), c(0, 0, 0, 0, 0, 0.00233673672776743, 0.0223488000000001, + 0.040304673503435, 0.0576262998104982, 0.0732741199141993, 0.088455610793058, + 0.103199, 0.118707592060121, 0.134185928864089, 0.151183139276793, + 0.1702454, 0.191937, 0.2182298, 0.253577609846549, 0.307351538752588, + 0.407165223924639, 0.502529513927214, 0.605582108686126), c(0, + 0, 0, 0, 0, 0, 0, 0.0190621000375005, 0.0420071558734088, 0.0629230825705257, + 0.0833688260410605, 0.103199, 0.124118509153392, 0.145401945823358, + 0.168667287877079, 0.1939090000375, 0.222597428173282, 0.256984900377504, + 0.301709122144422, 0.366495424858649, 0.475152766217062, 0.572497835146252, + 0.693762274318904), c(0, 0, 0, 0, 0, 0, 0, 0, 0.0269530072946728, + 0.0530040092850928, 0.0782481277003769, 0.103199, 0.12816325599641, + 0.154866111682517, 0.182302899107341, 0.213783044306043, 0.248363904708547, + 0.28995690796288, 0.341627908394784, 0.413707680386504, 0.528381820556805, + 0.635771182105746, 0.77652465912812), c(0, 0, 0, 0, 0, 0, 0, 0, 0.0133969262208122, 0.0447913089328894, 0.0739787251314013, 0.103199, 0.132965213784838, 0.163644939246192, 0.196475575572506, 0.231647450729907, 0.271208219491195, 0.317741925837459, 0.376214875186902, 0.454693715463155, 0.578781950822058, 0.695278060333427, 0.835521146843828 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, - 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 0, - 0, 0, 0, 0, 0, 0, 0.000725156354313476, 0.036290207696477, 0.0701157049196494, - 0.103199, 0.136581757676227, 0.170980571439515, 0.20778982998995, - 0.247087076718167, 0.291689672899979, 0.343587258527985, 0.406717577407724, - 0.490437549306793, 0.620305872542078, 0.740730855925609, 0.888992767585756 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, - 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 0, - 0, 0.0701359181289814, 0.126021564763798, 0.165542973066331, - 0.197412078824538, 0.2254231, 0.24849244896414, 0.271074448350284, - 0.292116376731667, 0.3121244, 0.3321324, 0.3534741, 0.375505591313813, - 0.4001594, 0.4268368, 0.459466546351464, 0.501142770839258, 0.562143084394445, - 0.686511993260583, 0.808747521078011, 0.936070949770187), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0.00157374045240457, - 0.0698662194634446, 0.120287640452405, 0.16090076400914, 0.195966561494315, - 0.227802919628796, 0.257250456567366, 0.284352940452404, 0.3121244, - 0.338954445099751, 0.366682808562485, 0.395431772465525, 0.428410340452405, - 0.464424683613586, 0.505774640452405, 0.559060310062401, 0.635868688255882, - 0.771213743700187, 0.895124744284645, 1.02835689610128), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0.0203251909788099, - 0.0807941084801849, 0.131156594663197, 0.173483742579226, 0.211670557196072, - 0.246244078609487, 0.278363918673537, 0.3121244, 0.345057130768308, - 0.378403757196072, 0.414130127568126, 0.451969178608786, 0.495598517595426, - 0.545136665227352, 0.60807806098831, 0.695394235571256, 0.837130344811698, - 0.966111057134121, 1.11185508502426), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0.0477276069251695, - 0.103509981435814, 0.15221877094871, 0.195952578625286, 0.236147272793828, - 0.274650521629366, 0.3121244, 0.349346986282313, 0.388561057230272, - 0.429378978625286, 0.474721256740267, 0.523806740641156, 0.581962784214742, - 0.652062951302463, 0.746838578625286, 0.896492945755508, 1.0340527654686, - 1.19219029825678), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0.0166039560593608, 0.0776387168354182, - 0.132003170161801, 0.180530886857168, 0.22594722201882, 0.268822337600976, - 0.3121244, 0.354489864523245, 0.398378553881739, 0.444274543339083, - 0.494499388431484, 0.548837448212482, 0.612239188685087, - 0.690272902609576, 0.790473599123991, 0.950950996975469, - 1.09638828065763, 1.26930966690442), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0.214450885057551, - 0.288864871241312, 0.3250653, 0.3516615, 0.3716087, 0.386718885323753, - 0.399682691320713, 0.411042976158862, 0.4218461, 0.4329278, 0.444139278140181, - 0.456951313505885, 0.4720835, 0.4920307, 0.518626803531635, 0.555566110165902, - 0.636745822624727, 1.18069710590251, 1.79487371178211, 2.55270530204625 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, - 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 0, + ), c(0, 0, 0, 0, 0, 0, 0, 0, 0.000725156354313476, 0.036290207696477, + 0.0701157049196494, 0.103199, 0.136581757676227, 0.170980571439515, + 0.20778982998995, 0.247087076718167, 0.291689672899979, 0.343587258527985, + 0.406717577407724, 0.490437549306793, 0.620305872542078, 0.740730855925609, + 0.888992767585756), c(0, 0, 0, 0.0701359181289814, 0.126021564763798, + 0.165542973066331, 0.197412078824538, 0.2254231, 0.24849244896414, + 0.271074448350284, 0.292116376731667, 0.3121244, 0.3321324, 0.3534741, + 0.375505591313813, 0.4001594, 0.4268368, 0.459466546351464, 0.501142770839258, + 0.562143084394445, 0.686511993260583, 0.808747521078011, 0.936070949770187 + ), c(0, 0, 0, 0.00157374045240457, 0.0698662194634446, 0.120287640452405, + 0.16090076400914, 0.195966561494315, 0.227802919628796, 0.257250456567366, + 0.284352940452404, 0.3121244, 0.338954445099751, 0.366682808562485, + 0.395431772465525, 0.428410340452405, 0.464424683613586, 0.505774640452405, + 0.559060310062401, 0.635868688255882, 0.771213743700187, 0.895124744284645, + 1.02835689610128), c(0, 0, 0, 0, 0.0203251909788099, 0.0807941084801849, + 0.131156594663197, 0.173483742579226, 0.211670557196072, 0.246244078609487, + 0.278363918673537, 0.3121244, 0.345057130768308, 0.378403757196072, + 0.414130127568126, 0.451969178608786, 0.495598517595426, 0.545136665227352, + 0.60807806098831, 0.695394235571256, 0.837130344811698, 0.966111057134121, + 1.11185508502426), c(0, 0, 0, 0, 0, 0.0477276069251695, 0.103509981435814, + 0.15221877094871, 0.195952578625286, 0.236147272793828, 0.274650521629366, + 0.3121244, 0.349346986282313, 0.388561057230272, 0.429378978625286, + 0.474721256740267, 0.523806740641156, 0.581962784214742, 0.652062951302463, + 0.746838578625286, 0.896492945755508, 1.0340527654686, 1.19219029825678 + ), c(0, 0, 0, 0, 0, 0.0166039560593608, 0.0776387168354182, 0.132003170161801, + 0.180530886857168, 0.22594722201882, 0.268822337600976, 0.3121244, + 0.354489864523245, 0.398378553881739, 0.444274543339083, 0.494499388431484, + 0.548837448212482, 0.612239188685087, 0.690272902609576, 0.790473599123991, + 0.950950996975469, 1.09638828065763, 1.26930966690442), c(0, + 0, 0, 0.214450885057551, 0.288864871241312, 0.3250653, 0.3516615, + 0.3716087, 0.386718885323753, 0.399682691320713, 0.411042976158862, + 0.4218461, 0.4329278, 0.444139278140181, 0.456951313505885, 0.4720835, + 0.4920307, 0.518626803531635, 0.555566110165902, 0.636745822624727, + 1.18069710590251, 1.79487371178211, 2.55270530204625), c(0, 0, 0, 0.0412188277837779, 0.218851219710947, 0.281178109847399, 0.318187061211362, 0.346336916208562, 0.368500427783778, 0.387753955899259, 0.405439627783778, 0.4218461, 0.438238911502765, 0.455473161565916, 0.474946888792488, 0.497793222697627, 0.526600327783778, 0.565677321171112, 0.632773149305243, 0.891087255237454, 1.53723873883164, 2.07877430490449, - 2.80265665435411), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0.11916637099981, 0.229217761668717, - 0.283591182792578, 0.32089403701397, 0.351025234947199, 0.376764238355684, - 0.399580647158371, 0.4218461, 0.44387311299288, 0.466809871716417, - 0.493008689720547, 0.523409488360383, 0.563157298622986, - 0.621505313473235, 0.756485815282202, 1.12190615310943, 1.76010655352564, - 2.36678033794496, 2.94420631979259), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0.0166944520132201, - 0.165418069472795, 0.245206977511275, 0.294705591133411, 0.333122440419504, - 0.365628706470365, 0.393898304736197, 0.4218461, 0.449111464628896, - 0.478419567119571, 0.511583967360174, 0.551380591704217, 0.602914542469175, - 0.695207681738717, 0.912006796599716, 1.31516316514125, 1.94296465866439, - 2.56528565211139, 3.07364144272118), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0.095868346511765, - 0.20216012803078, 0.267545492825128, 0.314290150935209, 0.353895445422154, - 0.388115128404834, 0.4218461, 0.455823761272913, 0.49135719600286, - 0.53249009905049, 0.582341165610556, 0.654473427614026, 0.784511194125441, - 1.05644872659752, 1.47044175860169, 2.09183984013705, 2.69484857437112, - 3.1694157654766), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.189889609612846, 0.28831400446517, 0.378590156778518, - 0.474951757151471, 0.546550271666467, 0.599713541496415, - 0.636994072140471, 0.663814888730087, 0.6839305, 0.701811, - 0.71711131701917, 0.7319844, 0.746512343291783, 0.7621579, - 0.7800383, 0.800154, 0.826974702066021, 0.86472325100111, - 0.918612458720487, 0.988605006042461, 1.08324298909714, 1.1736324426019, - 1.27400190201593), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.0970521814156041, 0.21019273451422, 0.3073217, - 0.418096666577866, 0.489016664299943, 0.547102113575136, - 0.594490775323003, 0.63162246104581, 0.661579866583116, 0.687283, - 0.709633785855109, 0.7319844, 0.754030577281223, 0.776967707389074, - 0.802389, 0.832791429272493, 0.870576437517875, 0.917019363782438, - 0.973069487834329, 1.04481411391714, 1.15502640396814, 1.25613855529213, - 1.37419193312441), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.0121672025865257, 0.139873460696682, 0.245836896475015, - 0.366700877088971, 0.445024777793378, 0.506295707796278, - 0.557812941319663, 0.601634091201612, 0.639324955546405, - 0.673001603565436, 0.702827370737707, 0.7319844, 0.760387153293983, - 0.790515252114921, 0.823330663438584, 0.86065768198682, 0.904468070814958, - 0.954989716167962, 1.01626566701207, 1.09352836237872, 1.21548452077266, - 1.32239947141536, 1.46006378366371), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0.0755189873928237, - 0.192404624794198, 0.322282766861868, 0.409749729479745, 0.475729034228042, - 0.531171513462134, 0.579442333436034, 0.623023292701627, 0.662178609529395, - 0.697968947885378, 0.7319844, 0.766345465406154, 0.80256496503135, - 0.841452466611966, 0.884524366576965, 0.93218174000415, 0.988252217755677, - 1.05297410373014, 1.13838991320473, 1.27210128334768, 1.38822119412612, - 1.53603026586717), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0.0137515321313713, 0.140785106599616, 0.283710273212032, - 0.374321519596796, 0.446394180252102, 0.505830587319873, - 0.559570052916329, 0.606684360953109, 0.65111343293503, 0.692845474832798, - 0.7319844, 0.771333743893139, 0.812267094081241, 0.855930534362644, - 0.903545840608706, 0.955193592261423, 1.01560313647486, 1.08583632750787, - 1.17818451335943, 1.31856131315813, 1.44615719776698, 1.60468791291453 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, - 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, - 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0.0124103998425985, 0.0518320161167612, - 0.0822283734557346, 0.106956582246572, 0.130236689538895, - 0.150852198845738, 0.168835673455735, 0.183678547429124, - 0.1975426, 0.211166273455735, 0.226249473455735, 0.243919155834858, - 0.265304527061771, 0.289781663064881, 0.315985067670677, - 0.347644682675627, 0.394981842425824, 0.491215248628636, - 0.584975102439074, 0.694697494489265), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0.0106056685868359, + 2.80265665435411), c(0, 0, 0, 0, 0.11916637099981, 0.229217761668717, + 0.283591182792578, 0.32089403701397, 0.351025234947199, 0.376764238355684, + 0.399580647158371, 0.4218461, 0.44387311299288, 0.466809871716417, + 0.493008689720547, 0.523409488360383, 0.563157298622986, 0.621505313473235, + 0.756485815282202, 1.12190615310943, 1.76010655352564, 2.36678033794496, + 2.94420631979259), c(0, 0, 0, 0, 0.0166944520132201, 0.165418069472795, + 0.245206977511275, 0.294705591133411, 0.333122440419504, 0.365628706470365, + 0.393898304736197, 0.4218461, 0.449111464628896, 0.478419567119571, + 0.511583967360174, 0.551380591704217, 0.602914542469175, 0.695207681738717, + 0.912006796599716, 1.31516316514125, 1.94296465866439, 2.56528565211139, + 3.07364144272118), c(0, 0, 0, 0, 0, 0.095868346511765, 0.20216012803078, + 0.267545492825128, 0.314290150935209, 0.353895445422154, 0.388115128404834, + 0.4218461, 0.455823761272913, 0.49135719600286, 0.53249009905049, + 0.582341165610556, 0.654473427614026, 0.784511194125441, 1.05644872659752, + 1.47044175860169, 2.09183984013705, 2.69484857437112, 3.1694157654766 + ), c(0.189889609612846, 0.28831400446517, 0.378590156778518, + 0.474951757151471, 0.546550271666467, 0.599713541496415, 0.636994072140471, + 0.663814888730087, 0.6839305, 0.701811, 0.71711131701917, 0.7319844, + 0.746512343291783, 0.7621579, 0.7800383, 0.800154, 0.826974702066021, + 0.86472325100111, 0.918612458720487, 0.988605006042461, 1.08324298909714, + 1.1736324426019, 1.27400190201593), c(0.0970521814156041, 0.21019273451422, + 0.3073217, 0.418096666577866, 0.489016664299943, 0.547102113575136, + 0.594490775323003, 0.63162246104581, 0.661579866583116, 0.687283, + 0.709633785855109, 0.7319844, 0.754030577281223, 0.776967707389074, + 0.802389, 0.832791429272493, 0.870576437517875, 0.917019363782438, + 0.973069487834329, 1.04481411391714, 1.15502640396814, 1.25613855529213, + 1.37419193312441), c(0.0121672025865257, 0.139873460696682, 0.245836896475015, + 0.366700877088971, 0.445024777793378, 0.506295707796278, 0.557812941319663, + 0.601634091201612, 0.639324955546405, 0.673001603565436, 0.702827370737707, + 0.7319844, 0.760387153293983, 0.790515252114921, 0.823330663438584, + 0.86065768198682, 0.904468070814958, 0.954989716167962, 1.01626566701207, + 1.09352836237872, 1.21548452077266, 1.32239947141536, 1.46006378366371 + ), c(0, 0.0755189873928237, 0.192404624794198, 0.322282766861868, + 0.409749729479745, 0.475729034228042, 0.531171513462134, 0.579442333436034, + 0.623023292701627, 0.662178609529395, 0.697968947885378, 0.7319844, + 0.766345465406154, 0.80256496503135, 0.841452466611966, 0.884524366576965, + 0.93218174000415, 0.988252217755677, 1.05297410373014, 1.13838991320473, + 1.27210128334768, 1.38822119412612, 1.53603026586717), c(0, 0.0137515321313713, + 0.140785106599616, 0.283710273212032, 0.374321519596796, 0.446394180252102, + 0.505830587319873, 0.559570052916329, 0.606684360953109, 0.65111343293503, + 0.692845474832798, 0.7319844, 0.771333743893139, 0.812267094081241, + 0.855930534362644, 0.903545840608706, 0.955193592261423, 1.01560313647486, + 1.08583632750787, 1.17818451335943, 1.31856131315813, 1.44615719776698, + 1.60468791291453), c(0, 0, 0, 0.0124103998425985, 0.0518320161167612, + 0.0822283734557346, 0.106956582246572, 0.130236689538895, 0.150852198845738, + 0.168835673455735, 0.183678547429124, 0.1975426, 0.211166273455735, + 0.226249473455735, 0.243919155834858, 0.265304527061771, 0.289781663064881, + 0.315985067670677, 0.347644682675627, 0.394981842425824, 0.491215248628636, + 0.584975102439074, 0.694697494489265), c(0, 0, 0, 0, 0.0106056685868359, 0.0491424720812208, 0.0803975947094471, 0.108060576398464, 0.133638500841809, 0.155968088623186, 0.177107275224252, 0.1975426, 0.218180906543366, 0.239601831646016, 0.262811949904799, 0.28886838404664, 0.317235975224252, 0.350545157867879, 0.393998327257523, 0.454550976564066, 0.558555075803007, - 0.656859449317743, 0.763718974419534), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0.0185370189554894, + 0.656859449317743, 0.763718974419534), c(0, 0, 0, 0, 0, 0.0185370189554894, 0.0562218087603375, 0.0890356919950198, 0.118731362266373, 0.146216910144001, 0.172533896645116, 0.1975426, 0.223021121504065, 0.249412654553045, 0.277680444480195, 0.308522683806638, 0.342270845449704, 0.382702709814398, - 0.433443929063141, 0.501610622734127, 0.614175801063261, 0.715138862353848, - 0.833535553075286), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0, 0.0346528073343234, 0.0723584880324803, - 0.106222897173122, 0.138467941096611, 0.167844669490445, - 0.1975426, 0.227591504589096, 0.258479799230192, 0.290862843650987, - 0.325718759418194, 0.364163081687565, 0.409581315443156, - 0.46531554698862, 0.54043504498905, 0.659111642885379, 0.761453612496025, - 0.889794566241181), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0, 0.0134397969692197, 0.0557212574100741, - 0.0941597345954959, 0.130401776157262, 0.164200585080601, - 0.1975426, 0.231566981332063, 0.265597088493385, 0.30192115798073, - 0.341652226704467, 0.384249568152932, 0.43541812199952, 0.495340659591346, - 0.575765691755518, 0.703032070294999, 0.815605113815338, - 0.955488202108743), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr"))), class = c("distribution", - "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, + 0.433443929063141, 0.501610622734127, 0.61417580106326, 0.715138862353848, + 0.833535553075286), c(0, 0, 0, 0, 0, 0, 0.0346528073343234, 0.0723584880324803, + 0.106222897173122, 0.138467941096611, 0.167844669490445, 0.1975426, + 0.227591504589096, 0.258479799230192, 0.290862843650987, 0.325718759418194, + 0.364163081687565, 0.409581315443156, 0.46531554698862, 0.54043504498905, + 0.659111642885379, 0.761453612496025, 0.889794566241181), c(0, + 0, 0, 0, 0, 0, 0.0134397969692197, 0.0557212574100741, 0.0941597345954959, + 0.130401776157262, 0.164200585080601, 0.1975426, 0.231566981332063, + 0.265597088493385, 0.30192115798073, 0.341652226704467, 0.384249568152932, + 0.43541812199952, 0.495340659591346, 0.575765691755518, 0.703032070294999, + 0.815605113815338, 0.955488202108743)), quantile_levels = c(0.01, + 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, + 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 + ), class = c("quantile_pred", "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, - 18992), class = "Date"), target_date = structure(c(19006, 19013, - 19020, 19027, 19034, 19006, 19013, 19020, 19027, 19034, 19006, + 18992, 18992), class = "Date"), target_date = structure(c(19006, 19013, 19020, 19027, 19034, 19006, 19013, 19020, 19027, 19034, 19006, 19013, 19020, 19027, 19034, 19006, 19013, 19020, 19027, - 19034), class = "Date")), row.names = c(NA, -30L), class = c("tbl_df", + 19034, 19006, 19013, 19020, 19027, 19034, 19006, 19013, 19020, + 19027, 19034), class = "Date")), row.names = c(NA, -30L), class = c("tbl_df", "tbl", "data.frame")) --- @@ -726,287 +429,180 @@ 0.7319844, 0.7319844, 0.7319844, 0.1975426, 0.1975426, 0.1975426, 0.1975426, 0.1975426), ahead = c(1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, - 4L, 5L, 1L, 2L, 3L, 4L, 5L), .pred_distn = structure(list(structure(list( - values = c(0, 0, 0.00812835000000001, 0.07297428, 0.0936219, - 0.10421786, 0.1121285, 0.1201118, 0.1273693, 0.1317238, 0.1360783, - 0.1393442, 0.1426101, 0.1469646, 0.1513191, 0.1585766, 0.1665599, - 0.17447054, 0.1850665, 0.20571412, 0.27056005, 0.313941744999999, - 0.384931126999997), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0.0250982954899548, 0.0576421230361804, - 0.0776985410529105, 0.0929731777892779, 0.104205115094451, - 0.114209292598776, 0.123365027741977, 0.131496226094211, - 0.1393442, 0.147007648291083, 0.154990950042, 0.16406284204392, - 0.173835548288583, 0.185472494222942, 0.200167568392984, - 0.221760005190952, 0.260313716029161, 0.318794320716957, - 0.376941794597195, 0.461705276864399), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0.028693230499105, - 0.055453963203632, 0.0755679534410344, 0.0913921813275133, 0.104804902302573, - 0.117142722458225, 0.128444430213702, 0.1393442, 0.150479535783308, - 0.161776522458225, 0.173925041831968, 0.187540579925299, 0.204200618941439, - 0.225353161205212, 0.253695961466565, 0.294498109305393, 0.358245879234942, - 0.427563795224327, 0.501665748776186), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0.00587171510650109, - 0.0364866623781238, 0.0602683002957529, 0.0794861096145961, 0.0963414561651617, - 0.111439230212802, 0.125394639614746, 0.1393442, 0.153216527502025, - 0.167801944181742, 0.183359587288923, 0.200880434888349, 0.221656465706657, - 0.24743726609676, 0.279449270180852, 0.322415149384594, 0.395367499639696, - 0.464904880713406, 0.539558052669137), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0.019055042091221, - 0.0457625510440105, 0.068309473710537, 0.087945102194822, 0.106033592330923, - 0.123045226382564, 0.1393442, 0.155351600131351, 0.172491058371384, - 0.19101350900654, 0.211425349928599, 0.234936300692507, 0.264303292652126, - 0.299599722715327, 0.346282638921389, 0.423857010226352, 0.494689091614341, - 0.577833814673327), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0.00138033000000002, 0.030893965, 0.0479842, - 0.059815975, 0.07118759, 0.0815075, 0.0926819, 0.0992551, - 0.103199, 0.1071429, 0.1137161, 0.1248905, 0.13521041, 0.146582025, - 0.1584138, 0.175504035, 0.20501767, 0.25694586, 0.335051815, - 0.436709474), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0.0179658025100251, 0.0356060154111541, + 4L, 5L, 1L, 2L, 3L, 4L, 5L), .pred_distn = structure(list(c(0, + 0, 0.00812835000000001, 0.07297428, 0.0936219, 0.10421786, 0.1121285, + 0.1201118, 0.1273693, 0.1317238, 0.1360783, 0.1393442, 0.1426101, + 0.1469646, 0.1513191, 0.1585766, 0.1665599, 0.17447054, 0.1850665, + 0.20571412, 0.27056005, 0.313941744999999, 0.384931126999997), + c(0, 0, 0, 0.0250982954899548, 0.0576421230361804, 0.0776985410529105, + 0.0929731777892779, 0.104205115094451, 0.114209292598776, + 0.123365027741977, 0.131496226094211, 0.1393442, 0.147007648291083, + 0.154990950042, 0.16406284204392, 0.173835548288583, 0.185472494222942, + 0.200167568392984, 0.221760005190952, 0.260313716029161, + 0.318794320716957, 0.376941794597195, 0.461705276864399), + c(0, 0, 0, 0, 0.028693230499105, 0.055453963203632, 0.0755679534410344, + 0.0913921813275133, 0.104804902302573, 0.117142722458225, + 0.128444430213702, 0.1393442, 0.150479535783308, 0.161776522458225, + 0.173925041831968, 0.187540579925299, 0.204200618941439, + 0.225353161205212, 0.253695961466565, 0.294498109305393, + 0.358245879234942, 0.427563795224327, 0.501665748776186), + c(0, 0, 0, 0, 0.00587171510650109, 0.0364866623781238, 0.0602683002957529, + 0.0794861096145961, 0.0963414561651617, 0.111439230212802, + 0.125394639614746, 0.1393442, 0.153216527502025, 0.167801944181742, + 0.183359587288923, 0.200880434888349, 0.221656465706657, + 0.24743726609676, 0.279449270180852, 0.322415149384594, 0.395367499639696, + 0.464904880713406, 0.539558052669137), c(0, 0, 0, 0, 0, 0.019055042091221, + 0.0457625510440105, 0.068309473710537, 0.087945102194822, + 0.106033592330923, 0.123045226382564, 0.1393442, 0.155351600131351, + 0.172491058371384, 0.19101350900654, 0.211425349928599, 0.234936300692507, + 0.264303292652126, 0.299599722715327, 0.346282638921389, + 0.423857010226352, 0.494689091614341, 0.577833814673327), + c(0, 0, 0, 0.00138033000000002, 0.030893965, 0.0479842, 0.059815975, + 0.07118759, 0.0815075, 0.0926819, 0.0992551, 0.103199, 0.1071429, + 0.1137161, 0.1248905, 0.13521041, 0.146582025, 0.1584138, + 0.175504035, 0.20501767, 0.25694586, 0.335051815, 0.436709474 + ), c(0, 0, 0, 0, 0, 0.0179658025100251, 0.0356060154111541, 0.050834301692017, 0.0650050989327893, 0.0784417069434695, 0.0916422518458685, 0.103199, 0.115251501692017, 0.128398001692017, 0.142201701692017, 0.157319973859039, 0.174980914065641, 0.196101805086251, 0.223989860848608, 0.266334685464555, 0.354050965519204, 0.437948459272293, 0.520203978940639), - quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, - 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0, 0.0134241653129031, 0.0338447112456125, + c(0, 0, 0, 0, 0, 0, 0.0134241653129031, 0.0338447112456125, 0.052643303388484, 0.0699345638167383, 0.0866373614747148, 0.103199, 0.119627111136411, 0.137401026927169, 0.156056395793358, 0.175781901322513, 0.198564535163602, 0.226934571881819, 0.263862501322513, 0.317121769745397, 0.412419996940619, - 0.491470213131306, 0.580892509639735), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0, 0, - 0.0170903, 0.0403385023363734, 0.0616387632732329, 0.0827585779094291, - 0.103199, 0.123094939420544, 0.14464638301663, 0.1669589, 0.191770645535455, - 0.220735117412174, 0.254231042750228, 0.296807527848978, 0.357153759489695, - 0.45347931404539, 0.538725322834228, 0.636530647411066), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0, 0, 0, - 0.0026415954262542, 0.0297423239924899, 0.0555402340406406, 0.0792255827466275, - 0.103199, 0.127366925585556, 0.151700351432014, 0.177708522618176, - 0.206088123699737, 0.238712707453825, 0.277708313715037, 0.325132239647296, - 0.390468252727729, 0.490417296529864, 0.578557086846368, 0.688679948593326 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, - 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 0.0320461375000001, - 0.129384955, 0.18940881, 0.2200878, 0.2427634, 0.2587698, 0.2734423, - 0.2841133, 0.296118, 0.3041212, 0.3121244, 0.3201276, 0.3281308, - 0.3401355, 0.3508065, 0.365479, 0.3814854, 0.404161, 0.43483999, - 0.494863845, 0.592202662499998, 0.737413847999994), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0.0319186440152902, - 0.118606588418984, 0.166386434627046, 0.198884154069741, 0.224089313858389, - 0.245418255377554, 0.2641052, 0.281445422925429, 0.297451875378704, - 0.3121244, 0.327667648091081, 0.343487967727477, 0.360314881408664, - 0.379575527422374, 0.400991145952209, 0.426605204088841, 0.4588495, - 0.506128350755908, 0.604640728888889, 0.713520019350718, 0.848429920658984 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, - 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 0, - 0, 0.0628145244703447, 0.119951261697167, 0.161800708429584, - 0.194481529786298, 0.221976473503235, 0.246382528361484, 0.268661795456855, - 0.29099237601426, 0.3121244, 0.332687273503235, 0.354487379145491, - 0.376704773503235, 0.401222379758598, 0.428725473503235, 0.462071908680987, - 0.503745448659536, 0.564825512591627, 0.677307126205362, 0.788889302835928, - 0.92389000979736), quantile_levels = c(0.01, 0.025, 0.05, 0.1, - 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, - 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0.0154147362739629, 0.0815589624901754, - 0.130419447103471, 0.16933591200637, 0.202296191455315, 0.23230661698317, - 0.260103744489245, 0.28583424396924, 0.3121244, 0.337226511153312, - 0.3628113, 0.3894886, 0.419049975899859, 0.453339140405904, - 0.492830630339104, 0.542883079890499, 0.613577832767128, - 0.73571689900399, 0.853844909059791, 0.988010467319443), - quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, - 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0.0493531737111374, 0.104172112803728, - 0.147940700281253, 0.185518687303273, 0.220197034594646, - 0.2521005, 0.282477641919719, 0.3121244, 0.3414694, 0.371435390499905, - 0.402230766363414, 0.436173824348844, 0.474579164424894, - 0.519690345185252, 0.576673752066771, 0.655151246845668, - 0.78520792902029, 0.90968118047453, 1.05112182091783), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0.28439515, 0.33688581, - 0.369872555, 0.3863845, 0.3945111, 0.40189893, 0.4078092, 0.4137194, - 0.4174134, 0.4218461, 0.4262788, 0.4299728, 0.435883, 0.44179327, - 0.4491811, 0.4573077, 0.473819645, 0.50680639, 0.55929705, 0.9841905175, - 1.556671116), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, - 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, - 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0.003694, 0.268840486221162, 0.320208490155752, + 0.491470213131306, 0.580892509639735), c(0, 0, 0, 0, 0, 0, + 0, 0.0170903, 0.0403385023363734, 0.0616387632732329, 0.0827585779094291, + 0.103199, 0.123094939420544, 0.14464638301663, 0.1669589, + 0.191770645535455, 0.220735117412174, 0.254231042750228, + 0.296807527848978, 0.357153759489695, 0.45347931404539, 0.538725322834228, + 0.636530647411066), c(0, 0, 0, 0, 0, 0, 0, 0.0026415954262542, + 0.0297423239924899, 0.0555402340406406, 0.0792255827466275, + 0.103199, 0.127366925585556, 0.151700351432014, 0.177708522618176, + 0.206088123699737, 0.238712707453825, 0.277708313715037, + 0.325132239647296, 0.390468252727729, 0.490417296529864, + 0.578557086846368, 0.688679948593326), c(0, 0.0320461375000001, + 0.129384955, 0.18940881, 0.2200878, 0.2427634, 0.2587698, + 0.2734423, 0.2841133, 0.296118, 0.3041212, 0.3121244, 0.3201276, + 0.3281308, 0.3401355, 0.3508065, 0.365479, 0.3814854, 0.404161, + 0.43483999, 0.494863845, 0.592202662499998, 0.737413847999994 + ), c(0, 0, 0.0319186440152902, 0.118606588418984, 0.166386434627046, + 0.198884154069741, 0.224089313858389, 0.245418255377554, + 0.2641052, 0.281445422925429, 0.297451875378704, 0.3121244, + 0.327667648091081, 0.343487967727477, 0.360314881408664, + 0.379575527422374, 0.400991145952209, 0.426605204088841, + 0.4588495, 0.506128350755908, 0.604640728888889, 0.713520019350718, + 0.848429920658984), c(0, 0, 0, 0.0628145244703447, 0.119951261697167, + 0.161800708429584, 0.194481529786298, 0.221976473503235, + 0.246382528361484, 0.268661795456855, 0.29099237601426, 0.3121244, + 0.332687273503235, 0.354487379145491, 0.376704773503235, + 0.401222379758598, 0.428725473503235, 0.462071908680987, + 0.503745448659536, 0.564825512591627, 0.677307126205362, + 0.788889302835928, 0.92389000979736), c(0, 0, 0, 0.0154147362739629, + 0.0815589624901754, 0.130419447103471, 0.16933591200637, + 0.202296191455315, 0.23230661698317, 0.260103744489245, 0.28583424396924, + 0.3121244, 0.337226511153312, 0.3628113, 0.3894886, 0.419049975899859, + 0.453339140405904, 0.492830630339104, 0.542883079890499, + 0.613577832767128, 0.73571689900399, 0.853844909059791, 0.988010467319443 + ), c(0, 0, 0, 0, 0.0493531737111374, 0.104172112803728, 0.147940700281253, + 0.185518687303273, 0.220197034594646, 0.2521005, 0.282477641919719, + 0.3121244, 0.3414694, 0.371435390499905, 0.402230766363414, + 0.436173824348844, 0.474579164424894, 0.519690345185252, + 0.57667375206677, 0.655151246845668, 0.78520792902029, 0.90968118047453, + 1.05112182091783), c(0, 0, 0.28439515, 0.33688581, 0.369872555, + 0.3863845, 0.3945111, 0.40189893, 0.4078092, 0.4137194, 0.4174134, + 0.4218461, 0.4262788, 0.4299728, 0.435883, 0.44179327, 0.4491811, + 0.4573077, 0.473819645, 0.50680639, 0.55929705, 0.9841905175, + 1.556671116), c(0, 0, 0.003694, 0.268840486221162, 0.320208490155752, 0.34804029700677, 0.368653615349654, 0.3834292, 0.3945111, 0.4041153, 0.413171785132151, 0.4218461, 0.430424661802068, 0.4395769, 0.4491812, 0.4610017, 0.47590450199302, 0.497193409669697, 0.525275921931869, 0.57616046396334, 0.97179808113241, 1.42880557869041, - 2.00265362857685), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0.0925362072632727, 0.270427502912579, + 2.00265362857685), c(0, 0, 0, 0.0925362072632727, 0.270427502912579, 0.315212102423624, 0.343335698090731, 0.364285966419164, 0.381412585636556, 0.3959887, 0.4092868, 0.4218461, 0.4344055, 0.447738051828318, 0.4632179, 0.480948870517105, 0.502553166907419, 0.531676966454865, 0.576804782629326, 0.776643061384413, - 1.21840177544959, 1.666716830807, 2.19163048441111), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, - 0.99)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0.186887482630176, - 0.277238777881179, 0.317854348809488, 0.345779327332173, 0.367941987952029, - 0.38755201396574, 0.405055828677287, 0.4218461, 0.438666668060931, - 0.456611962704227, 0.476718028677287, 0.499751625882259, 0.528508989683397, - 0.569810205861059, 0.666081219804098, 0.934028445917159, 1.42658287124316, - 1.85311957889209, 2.30760254154095), quantile_levels = c(0.01, + 1.21840177544959, 1.666716830807, 2.19163048441111), c(0, + 0, 0, 0, 0.186887482630176, 0.277238777881179, 0.317854348809488, + 0.345779327332173, 0.367941987952029, 0.38755201396574, 0.405055828677287, + 0.4218461, 0.438666668060931, 0.456611962704227, 0.476718028677287, + 0.499751625882259, 0.528508989683397, 0.569810205861059, + 0.666081219804098, 0.934028445917159, 1.42658287124316, 1.85311957889209, + 2.30760254154095), c(0, 0, 0, 0, 0.0845659921302213, 0.228553649752897, + 0.289236861333113, 0.326073140839108, 0.354785333802038, + 0.379166830409904, 0.401230227456875, 0.4218461, 0.442801275729157, + 0.465572618600986, 0.490133389090691, 0.520052318734487, + 0.558588500497255, 0.62065225601836, 0.788392143304334, 1.05428294678997, + 1.55684044507063, 2.01374350966068, 2.37954449328776), c(0.33818795, + 0.4386877525, 0.528816855, 0.61252005, 0.6626973, 0.6816954, + 0.697340875, 0.7085162, 0.7152214, 0.7208091, 0.72745833, + 0.7319844, 0.73651047, 0.7431597, 0.7487474, 0.7554526, 0.766627925, + 0.7822734, 0.8012715, 0.85144875, 0.935151945, 1.0252810475, + 1.12578085), c(0.276821846502455, 0.354318476867519, 0.440270225449805, + 0.533132934163242, 0.5900576, 0.631102729748298, 0.660462274661497, + 0.680831108876989, 0.696223359635746, 0.7096337, 0.7219265, + 0.7319844, 0.7431597, 0.7543351, 0.7677455, 0.783391, 0.804046832839828, + 0.833541896886769, 0.873735298798638, 0.929106903073231, + 1.02188617627186, 1.10971107833641, 1.18626816850867), c(0.202265200637946, + 0.298325094034965, 0.380907645938709, 0.481339524857949, + 0.543219696138311, 0.589507953775938, 0.6258186, 0.654874580912809, + 0.6783427, 0.6984583, 0.715655544727447, 0.7319844, 0.7487473, + 0.7666278, 0.785715489951649, 0.8090941, 0.83815, 0.873623567291473, + 0.920206978680437, 0.98231174201862, 1.08425930872329, 1.16639411427812, + 1.25926838507547), c(0.129193504425124, 0.241744300793533, + 0.331949483165032, 0.43649858695157, 0.504472062268773, 0.556141464729147, + 0.597172505336053, 0.631406591640416, 0.660898437441874, + 0.686684727470375, 0.709633972330423, 0.7319844, 0.753217699696647, + 0.77608746100351, 0.8012715950276, 0.830327492252422, 0.86464477397774, + 0.906319686121761, 0.956815387818928, 1.02495125855129, 1.13129413647201, + 1.21644533535035, 1.32424172966634), c(0.0667682979050189, + 0.189580042212397, 0.290485041721667, 0.402951609190092, + 0.475328740486855, 0.530590906520765, 0.575504908587586, + 0.613421932920829, 0.647285177364573, 0.678099283398734, + 0.70593862799773, 0.7319844, 0.758701322488325, 0.786639532920829, + 0.816837200234752, 0.850627936753767, 0.888963924063491, + 0.933785069065791, 0.988913131611816, 1.06240172852619, 1.16959624730917, + 1.2662008825538, 1.38860505690239), c(0, 0, 0.0419413650000001, + 0.09882005, 0.1230992, 0.14226962, 0.1600776, 0.1722416, + 0.1800265, 0.1880061, 0.1936501, 0.1975426, 0.2014351, 0.2070791, + 0.2150587, 0.2228436, 0.2350076, 0.25281558, 0.271986, 0.29626515, + 0.353143835, 0.4353357125, 0.545314878), c(0, 0, 0, 0.0438463650372504, + 0.0808594787511875, 0.106995615813358, 0.127478232938079, + 0.145480846633466, 0.1610508, 0.17461199504795, 0.186668812203222, + 0.1975426, 0.208428571374764, 0.2204108, 0.233930283744537, + 0.249894552784127, 0.267362348440485, 0.288755575723157, + 0.316120297580926, 0.355450425419354, 0.443192503687136, + 0.536871211931719, 0.636344785545224), c(0, 0, 0, 0.00188932708477086, + 0.0470905919531195, 0.079226864399944, 0.105414109111591, + 0.127225815559956, 0.146699420891509, 0.164644114298843, + 0.18142942603581, 0.1975426, 0.213933119201142, 0.231001630488804, + 0.24941229702312, 0.269578845560456, 0.292362546530965, 0.319632071367214, + 0.354433951358713, 0.406915236639266, 0.506944745332152, + 0.596044605353528, 0.695533388807317), c(0, 0, 0, 0, 0.0156342454546545, + 0.0536811248488485, 0.084228833507335, 0.110407751354614, + 0.134410113872139, 0.156669167575476, 0.177701902429674, + 0.1975426, 0.217759024165492, 0.238897316673167, 0.261484572608426, + 0.286120039498095, 0.313065324705997, 0.345395334882349, + 0.386811116673167, 0.44780805303823, 0.550781846423163, 0.644984940689833, + 0.752937731654986), c(0, 0, 0, 0, 0, 0.0290260214229144, + 0.0653218111708617, 0.0966336637233373, 0.124670861123061, + 0.149775978614687, 0.174275935467055, 0.1975426, 0.221291415429954, + 0.246723385601356, 0.273144383515685, 0.30101566402084, 0.33204051788793, + 0.369730347126771, 0.416909038104281, 0.481925596660567, + 0.58989871202142, 0.688635568252056, 0.803906183401304)), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0, 0, 0.0845659921302213, - 0.228553649752897, 0.289236861333113, 0.326073140839108, 0.354785333802038, - 0.379166830409904, 0.401230227456875, 0.4218461, 0.442801275729157, - 0.465572618600986, 0.490133389090691, 0.520052318734487, 0.558588500497255, - 0.62065225601836, 0.788392143304334, 1.05428294678997, 1.55684044507063, - 2.01374350966068, 2.37954449328776), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.33818795, 0.4386877525, - 0.528816855, 0.61252005, 0.6626973, 0.6816954, 0.697340875, 0.7085162, - 0.7152214, 0.7208091, 0.72745833, 0.7319844, 0.73651047, 0.7431597, - 0.7487474, 0.7554526, 0.766627925, 0.7822734, 0.8012715, 0.85144875, - 0.935151945, 1.0252810475, 1.12578085), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.276821846502455, - 0.354318476867519, 0.440270225449805, 0.533132934163242, 0.5900576, - 0.631102729748298, 0.660462274661497, 0.680831108876989, 0.696223359635746, - 0.7096337, 0.7219265, 0.7319844, 0.7431597, 0.7543351, 0.7677455, - 0.783391, 0.804046832839828, 0.833541896886769, 0.873735298798638, - 0.929106903073231, 1.02188617627186, 1.10971107833641, 1.18626816850867 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, - 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, - 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0.202265200637946, - 0.298325094034965, 0.380907645938709, 0.481339524857949, 0.543219696138311, - 0.589507953775938, 0.6258186, 0.654874580912809, 0.6783427, 0.6984583, - 0.715655544727447, 0.7319844, 0.7487473, 0.7666278, 0.785715489951649, - 0.8090941, 0.83815, 0.873623567291473, 0.920206978680437, 0.98231174201862, - 1.08425930872329, 1.16639411427812, 1.25926838507547), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.129193504425124, - 0.241744300793533, 0.331949483165032, 0.43649858695157, 0.504472062268773, - 0.556141464729147, 0.597172505336053, 0.631406591640416, 0.660898437441874, - 0.686684727470375, 0.709633972330423, 0.7319844, 0.753217699696647, - 0.77608746100351, 0.8012715950276, 0.830327492252422, 0.86464477397774, - 0.906319686121761, 0.956815387818928, 1.02495125855129, 1.13129413647201, - 1.21644533535035, 1.32424172966634), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.0667682979050189, - 0.189580042212397, 0.290485041721667, 0.402951609190092, 0.475328740486855, - 0.530590906520765, 0.575504908587586, 0.613421932920829, 0.647285177364573, - 0.678099283398734, 0.70593862799773, 0.7319844, 0.758701322488325, - 0.786639532920829, 0.816837200234752, 0.850627936753767, 0.888963924063491, - 0.933785069065791, 0.988913131611816, 1.06240172852619, 1.16959624730917, - 1.2662008825538, 1.38860505690239), quantile_levels = c(0.01, - 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 0.0419413650000001, - 0.09882005, 0.1230992, 0.14226962, 0.1600776, 0.1722416, 0.1800265, - 0.1880061, 0.1936501, 0.1975426, 0.2014351, 0.2070791, 0.2150587, - 0.2228436, 0.2350076, 0.25281558, 0.271986, 0.29626515, 0.353143835, - 0.4353357125, 0.545314878), quantile_levels = c(0.01, 0.025, - 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, - 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0.0438463650372504, 0.0808594787511875, - 0.106995615813358, 0.127478232938079, 0.145480846633466, - 0.1610508, 0.17461199504795, 0.186668812203222, 0.1975426, - 0.208428571374764, 0.2204108, 0.233930283744537, 0.249894552784127, - 0.267362348440485, 0.288755575723157, 0.316120297580926, - 0.355450425419354, 0.443192503687136, 0.536871211931719, - 0.636344785545224), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0.00188932708477086, 0.0470905919531195, - 0.079226864399944, 0.105414109111591, 0.127225815559956, - 0.146699420891509, 0.164644114298843, 0.18142942603581, 0.1975426, - 0.213933119201142, 0.231001630488804, 0.24941229702312, 0.269578845560456, - 0.292362546530965, 0.319632071367214, 0.354433951358713, - 0.406915236639266, 0.506944745332152, 0.596044605353528, - 0.695533388807317), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0.0156342454546545, 0.0536811248488485, - 0.084228833507335, 0.110407751354614, 0.134410113872139, - 0.156669167575476, 0.177701902429674, 0.1975426, 0.217759024165492, - 0.238897316673167, 0.261484572608426, 0.286120039498095, - 0.313065324705997, 0.345395334882349, 0.386811116673167, - 0.44780805303823, 0.550781846423163, 0.644984940689833, 0.752937731654986 - ), quantile_levels = c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, - 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, - 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 0, 0, 0, 0.0290260214229144, 0.0653218111708617, - 0.0966336637233373, 0.124670861123061, 0.149775978614687, - 0.174275935467055, 0.1975426, 0.221291415429954, 0.246723385601356, - 0.273144383515685, 0.30101566402084, 0.33204051788793, 0.369730347126771, - 0.416909038104281, 0.481925596660567, 0.58989871202142, 0.688635568252056, - 0.803906183401304), quantile_levels = c(0.01, 0.025, 0.05, - 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, - 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr"))), class = c("distribution", - "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, + ), class = c("quantile_pred", "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, 18992, - 18992), class = "Date"), target_date = structure(c(18997, 19002, - 19007, 19012, 19017, 18997, 19002, 19007, 19012, 19017, 18997, + 18992, 18992), class = "Date"), target_date = structure(c(18997, 19002, 19007, 19012, 19017, 18997, 19002, 19007, 19012, 19017, 18997, 19002, 19007, 19012, 19017, 18997, 19002, 19007, 19012, - 19017), class = "Date")), row.names = c(NA, -30L), class = c("tbl_df", + 19017, 18997, 19002, 19007, 19012, 19017, 18997, 19002, 19007, + 19012, 19017), class = "Date")), row.names = c(NA, -30L), class = c("tbl_df", "tbl", "data.frame")) # arx_forecaster snapshots @@ -1014,37 +610,23 @@ structure(list(geo_value = c("ca", "fl", "ga", "ny", "pa", "tx" ), .pred = c(0.353013358779435, 0.648525432444877, 0.667670289394328, 1.1418673907239, 0.830448695683587, 0.329799431948649), .pred_distn = structure(list( - structure(list(values = c(0.171022956902288, 0.244945899624723, - 0.308032696431071, 0.353013358779435, 0.397994021127798, - 0.461080817934147, 0.535003760656582), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.46653503056773, 0.540457973290166, 0.603544770096514, - 0.648525432444877, 0.693506094793241, 0.756592891599589, - 0.830515834322024), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0.485679887517181, + c(0.171022956902288, 0.244945899624723, 0.308032696431071, + 0.353013358779435, 0.397994021127798, 0.461080817934147, + 0.535003760656582), c(0.46653503056773, 0.540457973290166, + 0.603544770096514, 0.648525432444877, 0.693506094793241, + 0.756592891599589, 0.830515834322024), c(0.485679887517181, 0.559602830239616, 0.622689627045964, 0.667670289394328, 0.712650951742692, 0.77573774854904, 0.849660691271475), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.959876988846753, - 1.03379993156919, 1.09688672837554, 1.1418673907239, 1.18684805307226, - 1.24993484987861, 1.32385779260105), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.64845829380644, 0.722381236528875, 0.785468033335223, - 0.830448695683587, 0.875429358031951, 0.938516154838299, - 1.01243909756073), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0.147809030071502, - 0.221731972793937, 0.284818769600285, 0.329799431948649, - 0.374780094297013, 0.437866891103361, 0.511789833825796), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr"))), class = c("distribution", "vctrs_vctr", - "list")), forecast_date = structure(c(18992, 18992, 18992, 18992, - 18992, 18992), class = "Date"), target_date = structure(c(18999, + c(0.959876988846753, 1.03379993156919, 1.09688672837554, + 1.1418673907239, 1.18684805307226, 1.24993484987861, 1.32385779260105 + ), c(0.64845829380644, 0.722381236528875, 0.785468033335223, + 0.830448695683587, 0.875429358031951, 0.938516154838299, + 1.01243909756073), c(0.147809030071502, 0.221731972793937, + 0.284818769600285, 0.329799431948649, 0.374780094297013, + 0.437866891103361, 0.511789833825796)), quantile_levels = c(0.05, + 0.1, 0.25, 0.5, 0.75, 0.9, 0.95), class = c("quantile_pred", + "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, + 18992, 18992, 18992, 18992), class = "Date"), target_date = structure(c(18999, 18999, 18999, 18999, 18999, 18999), class = "Date")), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame")) @@ -1053,35 +635,21 @@ structure(list(geo_value = c("ca", "fl", "ga", "ny", "pa", "tx" ), .pred = c(0.149303403634373, 0.139764664505948, 0.333186321066645, 0.470345577837144, 0.725986105412008, 0.212686665274007), .pred_distn = structure(list( - structure(list(values = c(0.0961118191398634, 0.118312393281548, - 0.13840396557592, 0.149303403634373, 0.160202841692825, 0.180294413987198, - 0.202494988128882), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0.0865730800114383, - 0.108773654153123, 0.128865226447495, 0.139764664505948, - 0.1506641025644, 0.170755674858773, 0.192956249000457), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.279994736572136, 0.30219531071382, 0.322286883008193, - 0.333186321066645, 0.344085759125097, 0.36417733141947, - 0.386377905561154), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0.417153993342634, + c(0.0961118191398634, 0.118312393281548, 0.13840396557592, + 0.149303403634373, 0.160202841692825, 0.180294413987198, + 0.202494988128882), c(0.0865730800114383, 0.108773654153123, + 0.128865226447495, 0.139764664505948, 0.1506641025644, 0.170755674858773, + 0.192956249000457), c(0.279994736572136, 0.30219531071382, + 0.322286883008193, 0.333186321066645, 0.344085759125097, + 0.36417733141947, 0.386377905561154), c(0.417153993342634, 0.439354567484319, 0.459446139778691, 0.470345577837144, 0.481245015895596, 0.501336588189969, 0.523537162331653), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.672794520917498, - 0.694995095059183, 0.715086667353556, 0.725986105412008, - 0.73688554347046, 0.756977115764833, 0.779177689906517), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.159495080779498, - 0.181695654921182, 0.201787227215555, 0.212686665274007, - 0.223586103332459, 0.243677675626832, 0.265878249768516), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr"))), class = c("distribution", "vctrs_vctr", + c(0.672794520917498, 0.694995095059183, 0.715086667353556, + 0.725986105412008, 0.73688554347046, 0.756977115764833, 0.779177689906517 + ), c(0.159495080779498, 0.181695654921182, 0.201787227215555, + 0.212686665274007, 0.223586103332459, 0.243677675626832, + 0.265878249768516)), quantile_levels = c(0.05, 0.1, 0.25, + 0.5, 0.75, 0.9, 0.95), class = c("quantile_pred", "vctrs_vctr", "list")), forecast_date = structure(c(18992, 18992, 18992, 18992, 18992, 18992), class = "Date"), target_date = structure(c(18993, 18993, 18993, 18993, 18993, 18993), class = "Date")), row.names = c(NA, @@ -1092,34 +660,20 @@ structure(list(geo_value = c("ca", "fl", "ga", "ny", "pa", "tx" ), .pred = c(0.303244704017742, 0.531332853311081, 0.58882794468598, 0.98869024921623, 0.79480199700164, 0.306895457225321), .pred_distn = structure(list( - structure(list(values = c(0.136509784083987, 0.202348949370703, - 0.263837900408968, 0.303244704017742, 0.342651507626517, - 0.404140458664782, 0.469979623951498), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.364597933377326, 0.430437098664042, 0.491926049702307, - 0.531332853311081, 0.570739656919856, 0.632228607958121, - 0.698067773244837), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0.422093024752224, + c(0.136509784083987, 0.202348949370703, 0.263837900408968, + 0.303244704017742, 0.342651507626517, 0.404140458664782, + 0.469979623951498), c(0.364597933377326, 0.430437098664042, + 0.491926049702307, 0.531332853311081, 0.570739656919856, + 0.632228607958121, 0.698067773244837), c(0.422093024752224, 0.48793219003894, 0.549421141077205, 0.58882794468598, 0.628234748294754, - 0.689723699333019, 0.755562864619735), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.821955329282475, 0.887794494569191, 0.949283445607456, - 0.98869024921623, 1.028097052825, 1.08958600386327, 1.15542516914999 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.628067077067884, + 0.689723699333019, 0.755562864619735), c(0.821955329282475, + 0.887794494569191, 0.949283445607456, 0.98869024921623, 1.028097052825, + 1.08958600386327, 1.15542516914999), c(0.628067077067884, 0.693906242354601, 0.755395193392866, 0.79480199700164, 0.834208800610414, - 0.895697751648679, 0.961536916935395), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.140160537291566, 0.205999702578282, 0.267488653616547, - 0.306895457225321, 0.346302260834096, 0.407791211872361, - 0.473630377159077), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr"))), class = c("distribution", + 0.895697751648679, 0.961536916935395), c(0.140160537291566, + 0.205999702578282, 0.267488653616547, 0.306895457225321, + 0.346302260834096, 0.407791211872361, 0.473630377159077)), quantile_levels = c(0.05, + 0.1, 0.25, 0.5, 0.75, 0.9, 0.95), class = c("quantile_pred", "vctrs_vctr", "list")), forecast_date = structure(c(18997, 18997, 18997, 18997, 18997, 18997), class = "Date"), target_date = structure(c(18998, 18998, 18998, 18998, 18998, 18998), class = "Date")), row.names = c(NA, @@ -1130,34 +684,20 @@ structure(list(geo_value = c("ca", "fl", "ga", "ny", "pa", "tx" ), .pred = c(0.303244704017742, 0.531332853311081, 0.58882794468598, 0.98869024921623, 0.79480199700164, 0.306895457225321), .pred_distn = structure(list( - structure(list(values = c(0.136509784083987, 0.202348949370703, - 0.263837900408968, 0.303244704017742, 0.342651507626517, - 0.404140458664782, 0.469979623951498), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.364597933377326, 0.430437098664042, 0.491926049702307, - 0.531332853311081, 0.570739656919856, 0.632228607958121, - 0.698067773244837), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0.422093024752224, + c(0.136509784083987, 0.202348949370703, 0.263837900408968, + 0.303244704017742, 0.342651507626517, 0.404140458664782, + 0.469979623951498), c(0.364597933377326, 0.430437098664042, + 0.491926049702307, 0.531332853311081, 0.570739656919856, + 0.632228607958121, 0.698067773244837), c(0.422093024752224, 0.48793219003894, 0.549421141077205, 0.58882794468598, 0.628234748294754, - 0.689723699333019, 0.755562864619735), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.821955329282475, 0.887794494569191, 0.949283445607456, - 0.98869024921623, 1.028097052825, 1.08958600386327, 1.15542516914999 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0.628067077067884, + 0.689723699333019, 0.755562864619735), c(0.821955329282475, + 0.887794494569191, 0.949283445607456, 0.98869024921623, 1.028097052825, + 1.08958600386327, 1.15542516914999), c(0.628067077067884, 0.693906242354601, 0.755395193392866, 0.79480199700164, 0.834208800610414, - 0.895697751648679, 0.961536916935395), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0.140160537291566, 0.205999702578282, 0.267488653616547, - 0.306895457225321, 0.346302260834096, 0.407791211872361, - 0.473630377159077), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr"))), class = c("distribution", + 0.895697751648679, 0.961536916935395), c(0.140160537291566, + 0.205999702578282, 0.267488653616547, 0.306895457225321, + 0.346302260834096, 0.407791211872361, 0.473630377159077)), quantile_levels = c(0.05, + 0.1, 0.25, 0.5, 0.75, 0.9, 0.95), class = c("quantile_pred", "vctrs_vctr", "list")), forecast_date = structure(c(18997, 18997, 18997, 18997, 18997, 18997), class = "Date"), target_date = structure(c(18998, 18998, 18998, 18998, 18998, 18998), class = "Date")), row.names = c(NA, diff --git a/tests/testthat/_snaps/wis-dist-quantiles.md b/tests/testthat/_snaps/wis-dist-quantiles.md deleted file mode 100644 index fb9cfbdf6..000000000 --- a/tests/testthat/_snaps/wis-dist-quantiles.md +++ /dev/null @@ -1,17 +0,0 @@ -# wis dispatches and produces the correct values - - Code - weighted_interval_score(1:10, 10) - Condition - Error in `weighted_interval_score()`: - ! Weighted interval score can only be calculated if `x` - has class . - ---- - - Code - weighted_interval_score(dist_quantiles(list(1:4, 8:11), 1:4 / 5), 1:3) - Condition - Error in `weighted_interval_score()`: - ! Can't recycle `x` (size 2) to match `actual` (size 3). - diff --git a/tests/testthat/test-grf_quantiles.R b/tests/testthat/test-grf_quantiles.R index 5adbf6518..32f581d7a 100644 --- a/tests/testthat/test-grf_quantiles.R +++ b/tests/testthat/test-grf_quantiles.R @@ -78,7 +78,7 @@ test_that("quantile_rand_forest operates with arx_forecaster", { z <- arx_forecaster(df, "cases", "cases", spec2) expect_identical( - nested_quantiles(z$predictions$.pred_distn[1])[[1]]$quantile_levels, + hardhat::extract_quantile_levels(z$predictions$.pred_distn), c(.05, .1, 0.25, .5, 0.75, .9, .95) ) }) diff --git a/tests/testthat/test-pivot_quantiles.R b/tests/testthat/test-pivot_quantiles.R index a4362cffb..af6f82727 100644 --- a/tests/testthat/test-pivot_quantiles.R +++ b/tests/testthat/test-pivot_quantiles.R @@ -42,3 +42,12 @@ test_that("quantile pivotting longer behaves", { expect_identical(pivot_quantiles_longer(tib, d1)$d1_value, c(1:3, 2:4)) }) + +test_that("nested_quantiles is deprecated, but works where possible", { + expect_snapshot(d <- dist_quantiles(list(1:4, 2:5), 1:4 / 5)) + expect_snapshot(o <- nested_quantiles(d)) + res <- as_tibble(hardhat::quantile_pred( + matrix(c(1:4, 2:5), nrow = 2, byrow = TRUE), 1:4 / 5) + ) + expect_identical(o |> mutate(.row = dplyr::row_number()) |> unnest(data), res) +}) diff --git a/tests/testthat/test-population_scaling.R b/tests/testthat/test-population_scaling.R index 6e4cd5df2..f2efde3c0 100644 --- a/tests/testthat/test-population_scaling.R +++ b/tests/testthat/test-population_scaling.R @@ -340,7 +340,6 @@ test_that("test joining by default columns with less common keys/classes", { pivot_quantiles_wider(.pred), dat1 %>% select(!"y") %>% - as_tibble() %>% mutate(`0.5` = c(2 * 5, 2 * 11)) ) @@ -377,7 +376,6 @@ test_that("test joining by default columns with less common keys/classes", { pivot_quantiles_wider(.pred), dat1b %>% select(!"y") %>% - as_tibble() %>% # geo 1 scaling used for both: mutate(`0.5` = c(2 * 5, 2 * 5)) ), @@ -419,10 +417,10 @@ test_that("test joining by default columns with less common keys/classes", { expect_equal( # get_test_data doesn't work with non-`epi_df`s, so provide test data manually: predict(fit(ewf1b2, dat1b2), dat1b2) %>% - pivot_quantiles_wider(.pred), + pivot_quantiles_wider(.pred) %>% + as_tibble(), dat1b2 %>% select(!"y") %>% - as_tibble() %>% # geo 1 scaling used for both: mutate(`0.5` = c(2 * 5, 2 * 5)) %>% select(geo_value, age_group, time_value, `0.5`) @@ -485,7 +483,8 @@ test_that("test joining by default columns with less common keys/classes", { ) expect_equal( forecast(fit(ewf2, dat2)) %>% - pivot_quantiles_wider(.pred), + pivot_quantiles_wider(.pred) %>% + as_tibble(), dat2 %>% select(!"y") %>% as_tibble() %>% @@ -522,7 +521,6 @@ test_that("test joining by default columns with less common keys/classes", { pivot_quantiles_wider(.pred), dat2b %>% select(!"y") %>% - as_tibble() %>% mutate(`0.5` = c(2 * 5, 2 * 11)) ), class = "epipredict__step_population_scaling__default_by_missing_suggested_keys" @@ -559,8 +557,7 @@ test_that("test joining by default columns with less common keys/classes", { # slightly edited copy-pasta due to test time selection: dat3 %>% select(!"y") %>% - as_tibble() %>% - slice_max(by = geo_value, time_value) %>% + dplyr::slice_max(by = geo_value, time_value) %>% mutate(`0.5` = 2 * 11) ) diff --git a/tests/testthat/test-step_adjust_latency.R b/tests/testthat/test-step_adjust_latency.R index 1e9127bbe..9a6910533 100644 --- a/tests/testthat/test-step_adjust_latency.R +++ b/tests/testthat/test-step_adjust_latency.R @@ -13,7 +13,6 @@ x <- tibble( ) %>% as_epi_df(as_of = as.POSIXct("2024-09-17")) max_time <- max(x$time_value) -class(attributes(x)$metadata$as_of) as_of <- attributes(x)$metadata$as_of ahead <- 7 latency <- 5 @@ -241,7 +240,12 @@ test_that("epi_adjust_latency extends multiple aheads", { # the as_of on x is today's date, which is >970 days in the future # also, there's no data >970 days in the past, so it gets an error trying to # fit on no data - expect_error(expect_warning(fit3 <- fit(epi_wf, data = x), class = "epipredict__prep.step_latency__very_large_latency"), class = "simpleError") + expect_error( + expect_warning( + fit3 <- fit(epi_wf, data = x), + class = "epipredict__prep.step_latency__very_large_latency"), + class = "simpleError" + ) # real date example fit3 <- fit(epi_wf, data = real_x) expect_equal( From b1d1630432ce11894fa0eb97fbfaec7a1fc4b744 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Tue, 25 Feb 2025 12:00:47 -0800 Subject: [PATCH 08/22] pass local checks --- NAMESPACE | 1 - R/make_smooth_quantile_reg.R | 10 ++++------ R/weighted_interval_score.R | 6 +++--- man/smooth_quantile_reg.Rd | 10 ++++------ man/weighted_interval_score.Rd | 6 +++--- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 4c43e2f45..4bb3d6fe1 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -202,7 +202,6 @@ export(rename) export(select) export(slather) export(smooth_quantile_reg) -export(snap) export(step_adjust_latency) export(step_climate) export(step_epi_ahead) diff --git a/R/make_smooth_quantile_reg.R b/R/make_smooth_quantile_reg.R index 1ca019f75..03d4e19af 100644 --- a/R/make_smooth_quantile_reg.R +++ b/R/make_smooth_quantile_reg.R @@ -41,13 +41,11 @@ #' ) #' pl <- pl %>% #' unnest(.pred) %>% -#' mutate(distn = nested_quantiles(distn)) %>% -#' unnest(distn) %>% +#' pivot_quantiles_wider(distn) %>% #' mutate( #' x = x[length(x) - 20] + ahead / 100 * 2 * pi, #' ahead = NULL -#' ) %>% -#' pivot_wider(names_from = distn_quantile_levels, values_from = distn_value) +#' ) #' plot(x, y, pch = 16, xlim = c(pi, 2 * pi), col = "lightgrey") #' curve(sin(x), add = TRUE) #' abline(v = fd, lty = 2) @@ -57,11 +55,11 @@ #' #' library(ggplot2) #' ggplot(data.frame(x = x, y = y), aes(x)) + -#' geom_ribbon(data = pl, aes(ymin = `0.2`, ymax = `0.8`), fill = "lightblue") + +#' geom_ribbon(data = pl, aes(ymin = `0.2`, ymax = `0.8`), fill = "cornflowerblue") + #' geom_point(aes(y = y), colour = "grey") + # observed data #' geom_function(fun = sin, colour = "black") + # truth #' geom_vline(xintercept = fd, linetype = "dashed") + # end of training data -#' geom_line(data = pl, aes(y = `0.5`), colour = "red") + # median prediction +#' geom_line(data = pl, aes(y = `0.5`), colour = "orange") + # median prediction #' theme_bw() + #' coord_cartesian(xlim = c(0, NA)) + #' ylab("y") diff --git a/R/weighted_interval_score.R b/R/weighted_interval_score.R index aa0c816a3..47187fe56 100644 --- a/R/weighted_interval_score.R +++ b/R/weighted_interval_score.R @@ -52,13 +52,13 @@ #' #' # Using some actual forecasts -------- #' library(dplyr) -#' jhu <- case_death_rate_subset %>% +#' training <- covid_case_death_rates %>% #' filter(time_value >= "2021-10-01", time_value <= "2021-12-01") #' preds <- flatline_forecaster( -#' jhu, "death_rate", +#' training, "death_rate", #' flatline_args_list(quantile_levels = c(.01, .025, 1:19 / 20, .975, .99)) #' )$predictions -#' actuals <- case_death_rate_subset %>% +#' actuals <- covid_case_death_rates %>% #' filter(time_value == as.Date("2021-12-01") + 7) %>% #' select(geo_value, time_value, actual = death_rate) #' preds <- left_join(preds, actuals, diff --git a/man/smooth_quantile_reg.Rd b/man/smooth_quantile_reg.Rd index 973a85879..5d401c795 100644 --- a/man/smooth_quantile_reg.Rd +++ b/man/smooth_quantile_reg.Rd @@ -60,13 +60,11 @@ pl <- predict( ) pl <- pl \%>\% unnest(.pred) \%>\% - mutate(distn = nested_quantiles(distn)) \%>\% - unnest(distn) \%>\% + pivot_quantiles_wider(distn) \%>\% mutate( x = x[length(x) - 20] + ahead / 100 * 2 * pi, ahead = NULL - ) \%>\% - pivot_wider(names_from = distn_quantile_levels, values_from = distn_value) + ) plot(x, y, pch = 16, xlim = c(pi, 2 * pi), col = "lightgrey") curve(sin(x), add = TRUE) abline(v = fd, lty = 2) @@ -76,11 +74,11 @@ lines(pl$x, pl$`0.5`, col = "red") library(ggplot2) ggplot(data.frame(x = x, y = y), aes(x)) + - geom_ribbon(data = pl, aes(ymin = `0.2`, ymax = `0.8`), fill = "lightblue") + + geom_ribbon(data = pl, aes(ymin = `0.2`, ymax = `0.8`), fill = "cornflowerblue") + geom_point(aes(y = y), colour = "grey") + # observed data geom_function(fun = sin, colour = "black") + # truth geom_vline(xintercept = fd, linetype = "dashed") + # end of training data - geom_line(data = pl, aes(y = `0.5`), colour = "red") + # median prediction + geom_line(data = pl, aes(y = `0.5`), colour = "orange") + # median prediction theme_bw() + coord_cartesian(xlim = c(0, NA)) + ylab("y") diff --git a/man/weighted_interval_score.Rd b/man/weighted_interval_score.Rd index 22a616b70..ef09d4da1 100644 --- a/man/weighted_interval_score.Rd +++ b/man/weighted_interval_score.Rd @@ -69,13 +69,13 @@ weighted_interval_score( # Using some actual forecasts -------- library(dplyr) -jhu <- case_death_rate_subset \%>\% +training <- covid_case_death_rates \%>\% filter(time_value >= "2021-10-01", time_value <= "2021-12-01") preds <- flatline_forecaster( - jhu, "death_rate", + training, "death_rate", flatline_args_list(quantile_levels = c(.01, .025, 1:19 / 20, .975, .99)) )$predictions -actuals <- case_death_rate_subset \%>\% +actuals <- covid_case_death_rates \%>\% filter(time_value == as.Date("2021-12-01") + 7) \%>\% select(geo_value, time_value, actual = death_rate) preds <- left_join(preds, actuals, From e049766b6c58f8d7c751febd2baa9cb7c44444a7 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Tue, 25 Feb 2025 12:05:03 -0800 Subject: [PATCH 09/22] bump news --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 9c30f2cf7..aaa0af2c0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,6 +17,9 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.0.x will indicat has an `na_rm` argument. - Moves `epiprocess` out of depends (#440). No internals have changed, but downstream users may need to add `library(epiprocess)` to existing code. +- Removes dependence on the `distributional` package, replacing the quantiles + with `hardhat::quantile_pred()`. Some associated functions are deprecated with + `lifecycle` messages. ## Improvements @@ -28,6 +31,7 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.0.x will indicat - Add `reference_date` as an argument to `epi_recipe()` - Add `step_climate()` to create "climate" predictor in forecast workflows - Add `climatological_forecaster()` to automatically create climate baselines +- Replace `dist_quantiles()` with `hardhat::quantile_pred()` ## Bug fixes From 893a52fbcd4223d5332fd5200a629c30116ee8f4 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Tue, 25 Feb 2025 12:21:02 -0800 Subject: [PATCH 10/22] style: fu --- R/layer_residual_quantiles.R | 5 +++-- R/quantile_pred-methods.R | 25 +++++++++++++---------- tests/testthat/test-pivot_quantiles.R | 5 ++--- tests/testthat/test-quantile_pred.R | 1 - tests/testthat/test-step_adjust_latency.R | 3 ++- tests/testthat/test-wis-quantile_pred.R | 3 ++- 6 files changed, 23 insertions(+), 19 deletions(-) diff --git a/R/layer_residual_quantiles.R b/R/layer_residual_quantiles.R index 0517a0ffd..b82d6ab91 100644 --- a/R/layer_residual_quantiles.R +++ b/R/layer_residual_quantiles.R @@ -126,10 +126,11 @@ slather.layer_residual_quantiles <- r <- r %>% summarize(dstn = quantile_pred(matrix(quantile( - c(.resid, s * .resid), probs = object$quantile_levels, na.rm = TRUE + c(.resid, s * .resid), + probs = object$quantile_levels, na.rm = TRUE ), nrow = 1), quantile_levels = object$quantile_levels)) # Check for NA - if (anyNA(as.matrix(r$dstn))) { + if (anyNA(as.matrix(r$dstn))) { cli_abort(c( "Residual quantiles could not be calculated due to missing residuals.", i = "This may be due to `n_train` < `ahead` in your {.cls epi_recipe}." diff --git a/R/quantile_pred-methods.R b/R/quantile_pred-methods.R index 134308da2..6694a0146 100644 --- a/R/quantile_pred-methods.R +++ b/R/quantile_pred-methods.R @@ -133,7 +133,7 @@ quantile_internal <- function(x, tau_out, middle) { # short circuit if we aren't actually extrapolating # matches to ~15 decimals if (all(tau_out %in% tau) && !anyNA(qvals)) { - return(qvals[ , match(tau_out, tau), drop = FALSE]) + return(qvals[, match(tau_out, tau), drop = FALSE]) } if (length(tau) < 2) { cli_abort(paste( @@ -152,7 +152,9 @@ quantile_internal <- function(x, tau_out, middle) { extrapolate_quantiles_single <- function(qvals, tau, tau_out, middle) { qvals_out <- rep(NA, length(tau_out)) good <- !is.na(qvals) - if (!any(good)) return(qvals_out) + if (!any(good)) { + return(qvals_out) + } qvals <- qvals[good] tau <- tau[good] @@ -169,21 +171,22 @@ extrapolate_quantiles_single <- function(qvals, tau, tau_out, middle) { if (middle == "cubic") { method <- "cubic" - result <- tryCatch({ - Q <- stats::splinefun(tau, qvals, method = "hyman") - quartiles <- Q(c(.25, .5, .75)) - }, - error = function(e) { - return(NA) - }) + result <- tryCatch( + { + Q <- stats::splinefun(tau, qvals, method = "hyman") + quartiles <- Q(c(.25, .5, .75)) + }, + error = function(e) { + return(NA) + } + ) } if (middle == "linear" || any(is.na(result))) { method <- "linear" quartiles <- stats::approx(tau, qvals, c(.25, .5, .75))$y } if (any(indm)) { - qvals_out[indm] <- switch( - method, + qvals_out[indm] <- switch(method, linear = stats::approx(tau, qvals, tau_out[indm])$y, cubic = Q(tau_out[indm]) ) diff --git a/tests/testthat/test-pivot_quantiles.R b/tests/testthat/test-pivot_quantiles.R index af6f82727..39db31b2f 100644 --- a/tests/testthat/test-pivot_quantiles.R +++ b/tests/testthat/test-pivot_quantiles.R @@ -40,14 +40,13 @@ test_that("quantile pivotting longer behaves", { expect_length(pivot_quantiles_longer(tib, d1), 4L) expect_identical(nrow(pivot_quantiles_longer(tib, d1)), 6L) expect_identical(pivot_quantiles_longer(tib, d1)$d1_value, c(1:3, 2:4)) - }) test_that("nested_quantiles is deprecated, but works where possible", { expect_snapshot(d <- dist_quantiles(list(1:4, 2:5), 1:4 / 5)) expect_snapshot(o <- nested_quantiles(d)) res <- as_tibble(hardhat::quantile_pred( - matrix(c(1:4, 2:5), nrow = 2, byrow = TRUE), 1:4 / 5) - ) + matrix(c(1:4, 2:5), nrow = 2, byrow = TRUE), 1:4 / 5 + )) expect_identical(o |> mutate(.row = dplyr::row_number()) |> unnest(data), res) }) diff --git a/tests/testthat/test-quantile_pred.R b/tests/testthat/test-quantile_pred.R index 90710c6e1..70d7c71a5 100644 --- a/tests/testthat/test-quantile_pred.R +++ b/tests/testthat/test-quantile_pred.R @@ -78,7 +78,6 @@ test_that("unary math works on quantiles", { 1:4 / 5 ) expect_identical(log(dstn), dstn2) - }) test_that("arithmetic works on quantiles", { diff --git a/tests/testthat/test-step_adjust_latency.R b/tests/testthat/test-step_adjust_latency.R index 9a6910533..80e31dc17 100644 --- a/tests/testthat/test-step_adjust_latency.R +++ b/tests/testthat/test-step_adjust_latency.R @@ -243,7 +243,8 @@ test_that("epi_adjust_latency extends multiple aheads", { expect_error( expect_warning( fit3 <- fit(epi_wf, data = x), - class = "epipredict__prep.step_latency__very_large_latency"), + class = "epipredict__prep.step_latency__very_large_latency" + ), class = "simpleError" ) # real date example diff --git a/tests/testthat/test-wis-quantile_pred.R b/tests/testthat/test-wis-quantile_pred.R index 187344af9..a51a67352 100644 --- a/tests/testthat/test-wis-quantile_pred.R +++ b/tests/testthat/test-wis-quantile_pred.R @@ -51,7 +51,8 @@ test_that("wis dispatches and produces the correct values", { )) expect_true(is.na( weighted_interval_score( - quantile_pred(rbind(1:4), 1:4 / 5), 2.5, 1:9 / 10, na_handling = "fail" + quantile_pred(rbind(1:4), 1:4 / 5), 2.5, 1:9 / 10, + na_handling = "fail" ) )) }) From e8d4e57dd019fe9d9d28495ad63ae6a242959034 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Tue, 25 Feb 2025 18:49:35 -0800 Subject: [PATCH 11/22] bump hh version to release --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 01e07520d..af8e94595 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -35,7 +35,7 @@ Imports: generics, ggplot2, glue, - hardhat (>= 1.4.0.9002), + hardhat (>= 1.4.1), lifecycle, lubridate, magrittr, From 3895f1355923e487f4caaedfa4f71923cd45b756 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 26 Feb 2025 13:44:35 -0800 Subject: [PATCH 12/22] allow for quantile() to threshold to an interval --- R/quantile_pred-methods.R | 54 ++++++++++++++++++++++++++--- man/quantile.quantile_pred.Rd | 64 +++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 5 deletions(-) create mode 100644 man/quantile.quantile_pred.Rd diff --git a/R/quantile_pred-methods.R b/R/quantile_pred-methods.R index 6694a0146..7548b58eb 100644 --- a/R/quantile_pred-methods.R +++ b/R/quantile_pred-methods.R @@ -115,14 +115,58 @@ vec_proxy_equal.quantile_pred <- function(x, ...) { # quantiles by treating quantile_pred like a distribution ----------------- +#' Quantiles from a distribution +#' +#' Given a [hardhat::quantile_pred] object, users may wish to compute additional +#' `quantile_levels` that are not part of the object. This function attempts +#' to estimate these quantities under some assumptions. Interior probabilities, +#' those contained within, existing probabilities are interpolated in a manner +#' controled by the `middle` argument. Those outside existing probabilities +#' are extrapolated under the assumption that the tails of the distribution +#' decays exponentially. Optionally, one may constrain _all_ quantiles to be +#' within some support (say, `[0, Inf)`). +#' +#' @inheritParams stats::quantile +#' @param ... unused +#' @param lower Scalar. Optional lower bound. +#' @param upper Scalar. Optional upper bound. +#' @param middle Controls how extrapolation to "interior" probabilities is +#' performed. "cubic" attempts to use [stats::splinefun()] while "linear" +#' uses [stats::approx()]. The "linear" method is used as a fallback if +#' "cubic" should fail for some reason. +#' +#' @returns a matrix with one row for each entry in `x` and one column for each +#' value in `probs`. If either has length 1, a vector. +#' @seealso [extrapolate_quantiles()] #' @export #' @importFrom stats quantile -quantile.quantile_pred <- function(x, p, na.rm = FALSE, ..., - middle = c("cubic", "linear")) { - arg_is_probabilities(p) - p <- sort(p) +#' +#' @examples +#' qp <- quantile_pred(matrix(1:8, nrow = 2, byrow = TRUE), 1:4 / 5) +#' quantile(qp) +#' quantile(qp, lower = 0) +#' quantile(qp, probs = 0.5) +#' quantile(qp, probs = 1:9 / 10) +quantile.quantile_pred <- function(x, + probs = seq(0, 1, 0.25), + na.rm = FALSE, + lower = -Inf, + upper = Inf, + middle = c("cubic", "linear"), + ... +) { + arg_is_probabilities(probs) + arg_is_scalar(lower, upper, na.rm) + arg_is_numeric(lower, upper) + arg_is_lgl(na.rm) + + if (lower > upper) { + cli_abort("`lower` must be less than `upper`.") + } + + if (is.unsorted(probs)) probs <- sort(probs) middle <- rlang::arg_match(middle) - quantile_internal(x, p, middle) + drop(snap(quantile_internal(x, probs, middle), lower, upper)) } diff --git a/man/quantile.quantile_pred.Rd b/man/quantile.quantile_pred.Rd new file mode 100644 index 000000000..c83e629b2 --- /dev/null +++ b/man/quantile.quantile_pred.Rd @@ -0,0 +1,64 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/quantile_pred-methods.R +\name{quantile.quantile_pred} +\alias{quantile.quantile_pred} +\title{Quantiles from a distribution} +\usage{ +\method{quantile}{quantile_pred}( + x, + probs = seq(0, 1, 0.25), + na.rm = FALSE, + lower = -Inf, + upper = Inf, + middle = c("cubic", "linear"), + ... +) +} +\arguments{ +\item{x}{numeric vector whose sample quantiles are wanted, or an + object of a class for which a method has been defined (see also + \sQuote{details}). \code{\link{NA}} and \code{NaN} values are not + allowed in numeric vectors unless \code{na.rm} is \code{TRUE}.} + +\item{probs}{numeric vector of probabilities with values in + \eqn{[0,1]}. (Values up to \samp{2e-14} outside that + range are accepted and moved to the nearby endpoint.)} + +\item{na.rm}{logical; if true, any \code{\link{NA}} and \code{NaN}'s + are removed from \code{x} before the quantiles are computed.} + +\item{lower}{Scalar. Optional lower bound.} + +\item{upper}{Scalar. Optional upper bound.} + +\item{middle}{Controls how extrapolation to "interior" probabilities is +performed. "cubic" attempts to use \code{\link[stats:splinefun]{stats::splinefun()}} while "linear" +uses \code{\link[stats:approxfun]{stats::approx()}}. The "linear" method is used as a fallback if +"cubic" should fail for some reason.} + +\item{...}{unused} +} +\value{ +a matrix with one row for each entry in \code{x} and one column for each +value in \code{probs}. If either has length 1, a vector. +} +\description{ +Given a \link[hardhat:quantile_pred]{hardhat::quantile_pred} object, users may wish to compute additional +\code{quantile_levels} that are not part of the object. This function attempts +to estimate these quantities under some assumptions. Interior probabilities, +those contained within, existing probabilities are interpolated in a manner +controled by the \code{middle} argument. Those outside existing probabilities +are extrapolated under the assumption that the tails of the distribution +decays exponentially. Optionally, one may constrain \emph{all} quantiles to be +within some support (say, \verb{[0, Inf)}). +} +\examples{ +qp <- quantile_pred(matrix(1:8, nrow = 2, byrow = TRUE), 1:4 / 5) +quantile(qp) +quantile(qp, lower = 0) +quantile(qp, probs = 0.5) +quantile(qp, probs = 1:9 / 10) +} +\seealso{ +\code{\link[=extrapolate_quantiles]{extrapolate_quantiles()}} +} From fb1669967c802cd3d9b69cdb73aafd36bce58cbb Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 26 Feb 2025 14:00:25 -0800 Subject: [PATCH 13/22] closes #434 --- NEWS.md | 1 + R/quantile_pred-methods.R | 4 ++-- man/quantile.quantile_pred.Rd | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index aaa0af2c0..13a9d93b3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -32,6 +32,7 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.0.x will indicat - Add `step_climate()` to create "climate" predictor in forecast workflows - Add `climatological_forecaster()` to automatically create climate baselines - Replace `dist_quantiles()` with `hardhat::quantile_pred()` +- Allow `quantile()` to threshold to an interval if desired (#434) ## Bug fixes diff --git a/R/quantile_pred-methods.R b/R/quantile_pred-methods.R index 7548b58eb..16b30f941 100644 --- a/R/quantile_pred-methods.R +++ b/R/quantile_pred-methods.R @@ -136,7 +136,7 @@ vec_proxy_equal.quantile_pred <- function(x, ...) { #' "cubic" should fail for some reason. #' #' @returns a matrix with one row for each entry in `x` and one column for each -#' value in `probs`. If either has length 1, a vector. +#' value in `probs` #' @seealso [extrapolate_quantiles()] #' @export #' @importFrom stats quantile @@ -166,7 +166,7 @@ quantile.quantile_pred <- function(x, if (is.unsorted(probs)) probs <- sort(probs) middle <- rlang::arg_match(middle) - drop(snap(quantile_internal(x, probs, middle), lower, upper)) + snap(quantile_internal(x, probs, middle), lower, upper) } diff --git a/man/quantile.quantile_pred.Rd b/man/quantile.quantile_pred.Rd index c83e629b2..246a3e987 100644 --- a/man/quantile.quantile_pred.Rd +++ b/man/quantile.quantile_pred.Rd @@ -40,7 +40,7 @@ uses \code{\link[stats:approxfun]{stats::approx()}}. The "linear" method is used } \value{ a matrix with one row for each entry in \code{x} and one column for each -value in \code{probs}. If either has length 1, a vector. +value in \code{probs} } \description{ Given a \link[hardhat:quantile_pred]{hardhat::quantile_pred} object, users may wish to compute additional From 297a65dcb887033bd4bf0cfb9ebfdefde0a32f97 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 26 Feb 2025 14:05:20 -0800 Subject: [PATCH 14/22] excise lingering distributional internals --- DESCRIPTION | 1 - NAMESPACE | 2 - R/layer_predictive_distn.R | 93 ++--------------------------------- R/layer_quantile_distn.R | 12 +---- R/pivot_quantiles.R | 32 +++--------- man/layer_predictive_distn.Rd | 24 ++------- man/nested_quantiles.Rd | 6 +-- 7 files changed, 17 insertions(+), 153 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index af8e94595..1ce1f8ef1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -50,7 +50,6 @@ Imports: workflows (>= 1.0.0) Suggests: data.table, - distributional, epidatr (>= 1.0.0), fs, grf, diff --git a/NAMESPACE b/NAMESPACE index 4bb3d6fe1..3c59dcb06 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -78,7 +78,6 @@ S3method(print,layer_naomit) S3method(print,layer_point_from_distn) S3method(print,layer_population_scaling) S3method(print,layer_predict) -S3method(print,layer_predictive_distn) S3method(print,layer_quantile_distn) S3method(print,layer_residual_quantiles) S3method(print,layer_threshold) @@ -104,7 +103,6 @@ S3method(slather,layer_naomit) S3method(slather,layer_point_from_distn) S3method(slather,layer_population_scaling) S3method(slather,layer_predict) -S3method(slather,layer_predictive_distn) S3method(slather,layer_quantile_distn) S3method(slather,layer_residual_quantiles) S3method(slather,layer_threshold) diff --git a/R/layer_predictive_distn.R b/R/layer_predictive_distn.R index 8ce55e1c3..824593f8d 100644 --- a/R/layer_predictive_distn.R +++ b/R/layer_predictive_distn.R @@ -1,5 +1,7 @@ #' Returns predictive distributions #' +#' `r lifecycle::badge("deprecated")` +#' #' This function calculates an _approximation_ to a parametric predictive #' distribution. Predictive distributions from linear models require #' `x* (X'X)^{-1} x*` @@ -16,102 +18,13 @@ #' #' @return an updated `frosting` postprocessor with additional columns of the #' residual quantiles added to the prediction - #' @export #' -#' @examples -#' library(dplyr) -#' jhu <- covid_case_death_rates %>% -#' filter(time_value > "2021-11-01", geo_value %in% c("ak", "ca", "ny")) -#' -#' r <- epi_recipe(jhu) %>% -#' step_epi_lag(death_rate, lag = c(0, 7, 14)) %>% -#' step_epi_ahead(death_rate, ahead = 7) %>% -#' step_epi_naomit() -#' -#' wf <- epi_workflow(r, linear_reg()) %>% fit(jhu) -#' -#' f <- frosting() %>% -#' layer_predict() %>% -#' layer_predictive_distn() %>% -#' layer_naomit(.pred) -#' wf1 <- wf %>% add_frosting(f) -#' -#' p <- forecast(wf1) -#' p layer_predictive_distn <- function(frosting, ..., dist_type = c("gaussian", "student_t"), truncate = c(-Inf, Inf), name = ".pred_distn", id = rand_id("predictive_distn")) { - if (!requireNamespace("distributional", quietly = TRUE)) { - cli_abort(paste( - "You must install the {.pkg distributional} package for", - "this functionality." - )) - } - rlang::check_dots_empty() - arg_is_chr_scalar(name, id) - dist_type <- match.arg(dist_type) - stopifnot( - length(truncate) == 2L, is.numeric(truncate), truncate[1] < truncate[2] - ) - - add_layer( - frosting, - layer_predictive_distn_new( - dist_type = dist_type, - truncate = truncate, - name = name, - id = id - ) - ) -} - -layer_predictive_distn_new <- function(dist_type, truncate, name, id) { - layer("predictive_distn", - dist_type = dist_type, truncate = truncate, - name = name, id = id - ) -} - -#' @export -slather.layer_predictive_distn <- - function(object, components, workflow, new_data, ...) { - the_fit <- workflows::extract_fit_parsnip(workflow) - rlang::check_dots_empty() - - m <- components$predictions$.pred - r <- grab_residuals(the_fit, components) - df <- the_fit$df.residual - n <- sum(!is.na(r)) - papprox <- ncol(components$mold$predictors) + 1 - if (is.null(df)) df <- n - papprox - mse <- sum(r^2, na.rm = TRUE) / df - s <- sqrt(mse * (1 + papprox / df)) # E[x (X'X)^1 x] if E[X'X] ~= (n-p) I - dstn <- switch(object$dist_type, - gaussian = distributional::dist_normal(m, s), - student_t = distributional::dist_student_t(df, m, s) - ) - truncate <- object$truncate - if (!all(is.infinite(truncate))) { - dstn <- distributional::dist_truncated(dstn, truncate[1], truncate[2]) - } - dstn <- tibble(dstn = dstn) - dstn <- check_pname(dstn, components$predictions, object) - components$predictions <- mutate(components$predictions, !!!dstn) - components - } - -#' @export -print.layer_predictive_distn <- function( - x, width = max(20, options()$width - 30), ...) { - title <- "Creating approximate predictive intervals" - td <- "" - td <- rlang::enquos(td) - print_layer(td, - title = title, width = width, conjunction = "type", - extra_text = x$dist_type - ) + lifecycle::deprecate_stop("0.1.11", "layer_predictive_distn()", "layer_residual_quantiles()") } diff --git a/R/layer_quantile_distn.R b/R/layer_quantile_distn.R index 67fbfa28c..c6bc217f3 100644 --- a/R/layer_quantile_distn.R +++ b/R/layer_quantile_distn.R @@ -78,20 +78,12 @@ layer_quantile_distn_new <- function(quantile_levels, truncate, name, id) { slather.layer_quantile_distn <- function(object, components, workflow, new_data, ...) { dstn <- components$predictions$.pred - is_supported <- inherits(dstn, "distribution") || - inherits(dstn, "quantile_pred") - if (!is_supported) { + if (!inherits(dstn, "quantile_pred")) { cli_abort( - "`layer_quantile_distn()` requires distributional or quantile + "`layer_quantile_distn()` requires or quantile predictions. These are of class {.cls {class(dstn)}}." ) } - if (inherits(dstn, "distribution") && !requireNamespace("distributional", quietly = TRUE)) { - cli_abort( - "You must install the {.pkg distributional} package for this - functionality." - ) - } rlang::check_dots_empty() dstn <- quantile_pred( diff --git a/R/pivot_quantiles.R b/R/pivot_quantiles.R index 8e846d7e6..e4b5b3320 100644 --- a/R/pivot_quantiles.R +++ b/R/pivot_quantiles.R @@ -12,39 +12,23 @@ #' @export #' #' @examples -#' .pred_quantile <- quantile_pred(matrix(rnorm(20), 5), c(.2, .4, .6, .8)) -#' nested_quantiles(.pred_quantile) +#' pred_quantile <- quantile_pred(matrix(rnorm(20), 5), c(.2, .4, .6, .8)) +#' nested_quantiles(pred_quantile) #' -#' .pred_quantile %>% +#' pred_quantile %>% #' as_tibble() %>% #' tidyr::nest(.by = .row) %>% #' dplyr::select(-.row) #' nested_quantiles <- function(x) { lifecycle::deprecate_warn("0.1.11", "nested_quantiles()", "hardhat::quantile_pred()") - if (inherits(x, "distribution")) { - if (requireNamespace("distributional")) { - x <- vctrs::vec_data(x) - return(distributional:::dist_apply(x, .f = function(z) { - as_tibble(vctrs::vec_data(z)) %>% - mutate(across(everything(), as.double)) %>% - vctrs::list_of() - })) - } else { - cli_abort(c( - "`nested_quantiles()` is deprecated and the {.pkg distributional}", - `!` = "package is not installed.", - i = "See {.fn hardhat::quantile_pred}." - )) - } - } if (inherits(x, "quantile_pred")) { return(x %>% as_tibble() %>% tidyr::nest(.by = .row) %>% dplyr::select(data)) } - cli_abort(c( + cli_abort( "`nested_quantiles()` is deprecated. See {.fn hardhat::quantile_pred}." - )) + ) } @@ -113,11 +97,7 @@ pivot_quantiles_wider <- function(.data, ...) { } pivot_quantiles <- function(.data, ...) { - msg <- c( - "{.fn pivot_quantiles} was deprecated in {.pkg epipredict} 0.0.6", - i = "Please use {.fn pivot_quantiles_wider} instead." - ) - lifecycle::deprecate_stop(msg) + lifecycle::deprecate_stop("0.0.6", "pivot_quantiles()", "pivot_quantiles_wider()") } validate_pivot_quantiles <- function(.data, ..., call = caller_env()) { diff --git a/man/layer_predictive_distn.Rd b/man/layer_predictive_distn.Rd index 3bd95425b..0e4b17cdb 100644 --- a/man/layer_predictive_distn.Rd +++ b/man/layer_predictive_distn.Rd @@ -31,6 +31,9 @@ an updated \code{frosting} postprocessor with additional columns of the residual quantiles added to the prediction } \description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} +} +\details{ This function calculates an \emph{approximation} to a parametric predictive distribution. Predictive distributions from linear models require \verb{x* (X'X)^\{-1\} x*} @@ -38,24 +41,3 @@ along with the degrees of freedom. This function approximates both. It should be reasonably accurate for models fit using \code{lm} when the new point \verb{x*} isn't too far from the bulk of the data. } -\examples{ -library(dplyr) -jhu <- covid_case_death_rates \%>\% - filter(time_value > "2021-11-01", geo_value \%in\% c("ak", "ca", "ny")) - -r <- epi_recipe(jhu) \%>\% - step_epi_lag(death_rate, lag = c(0, 7, 14)) \%>\% - step_epi_ahead(death_rate, ahead = 7) \%>\% - step_epi_naomit() - -wf <- epi_workflow(r, linear_reg()) \%>\% fit(jhu) - -f <- frosting() \%>\% - layer_predict() \%>\% - layer_predictive_distn() \%>\% - layer_naomit(.pred) -wf1 <- wf \%>\% add_frosting(f) - -p <- forecast(wf1) -p -} diff --git a/man/nested_quantiles.Rd b/man/nested_quantiles.Rd index 4b666ee32..c8c05d94f 100644 --- a/man/nested_quantiles.Rd +++ b/man/nested_quantiles.Rd @@ -20,10 +20,10 @@ This function is deprecated. The recommended alternative is \code{\link[hardhat:quantile_pred]{hardhat::quantile_pred()}} with \code{\link[tibble:as_tibble]{tibble::as_tibble()}} } \examples{ -.pred_quantile <- quantile_pred(matrix(rnorm(20), 5), c(.2, .4, .6, .8)) -nested_quantiles(.pred_quantile) +pred_quantile <- quantile_pred(matrix(rnorm(20), 5), c(.2, .4, .6, .8)) +nested_quantiles(pred_quantile) -.pred_quantile \%>\% +pred_quantile \%>\% as_tibble() \%>\% tidyr::nest(.by = .row) \%>\% dplyr::select(-.row) From 65b2ea4d80df65f6ba82b66e78ba42529893bd68 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 26 Feb 2025 14:28:13 -0800 Subject: [PATCH 15/22] unnecessary lazydata (no data) --- DESCRIPTION | 1 - 1 file changed, 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1ce1f8ef1..0d5398444 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -76,6 +76,5 @@ Remotes: Config/Needs/website: cmu-delphi/delphidocs Config/testthat/edition: 3 Encoding: UTF-8 -LazyData: true Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 From c7f492f420cd3c843c4998b1b24e8ae581bff335 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 26 Feb 2025 14:31:36 -0800 Subject: [PATCH 16/22] style --- R/quantile_pred-methods.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/R/quantile_pred-methods.R b/R/quantile_pred-methods.R index 16b30f941..84412e4dd 100644 --- a/R/quantile_pred-methods.R +++ b/R/quantile_pred-methods.R @@ -153,8 +153,7 @@ quantile.quantile_pred <- function(x, lower = -Inf, upper = Inf, middle = c("cubic", "linear"), - ... -) { + ...) { arg_is_probabilities(probs) arg_is_scalar(lower, upper, na.rm) arg_is_numeric(lower, upper) From cc405c729407a9da01eca16d821c2e3a9b65a48b Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 26 Feb 2025 15:30:39 -0800 Subject: [PATCH 17/22] bump version number --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0d5398444..8ced21d2d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: epipredict Title: Basic epidemiology forecasting methods -Version: 0.1.11 +Version: 0.1.12 Authors@R: c( person("Daniel J.", "McDonald", , "daniel@stat.ubc.ca", role = c("aut", "cre")), person("Ryan", "Tibshirani", , "ryantibs@cmu.edu", role = "aut"), From 161feb785288e50bc9391a76215ebf7216080ee5 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 5 Mar 2025 11:07:49 -0800 Subject: [PATCH 18/22] missing reexports --- R/reexports.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/R/reexports.R b/R/reexports.R index 2cc7aa9fa..4166b6e0c 100644 --- a/R/reexports.R +++ b/R/reexports.R @@ -65,3 +65,10 @@ tidyr::pivot_wider #' @importFrom tidyr unnest #' @export tidyr::unnest + +#' @importFrom hardhat quantile_pred extract_quantile_levels +#' @export +hardhat::quantile_pred + +#' @export +hardhat::extract_quantile_levels From c36b2421971acf7e3660c870881bb007ab55706a Mon Sep 17 00:00:00 2001 From: dsweber2 Date: Tue, 11 Mar 2025 18:24:21 -0500 Subject: [PATCH 19/22] minor docs, testing multiple pivot_longers --- R/quantile_pred-methods.R | 2 +- man/quantile.quantile_pred.Rd | 2 +- tests/testthat/test-pivot_quantiles.R | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/R/quantile_pred-methods.R b/R/quantile_pred-methods.R index 84412e4dd..293fad902 100644 --- a/R/quantile_pred-methods.R +++ b/R/quantile_pred-methods.R @@ -120,7 +120,7 @@ vec_proxy_equal.quantile_pred <- function(x, ...) { #' Given a [hardhat::quantile_pred] object, users may wish to compute additional #' `quantile_levels` that are not part of the object. This function attempts #' to estimate these quantities under some assumptions. Interior probabilities, -#' those contained within, existing probabilities are interpolated in a manner +#' those contained within existing probabilities are interpolated in a manner #' controled by the `middle` argument. Those outside existing probabilities #' are extrapolated under the assumption that the tails of the distribution #' decays exponentially. Optionally, one may constrain _all_ quantiles to be diff --git a/man/quantile.quantile_pred.Rd b/man/quantile.quantile_pred.Rd index 246a3e987..1c23daed4 100644 --- a/man/quantile.quantile_pred.Rd +++ b/man/quantile.quantile_pred.Rd @@ -46,7 +46,7 @@ value in \code{probs} Given a \link[hardhat:quantile_pred]{hardhat::quantile_pred} object, users may wish to compute additional \code{quantile_levels} that are not part of the object. This function attempts to estimate these quantities under some assumptions. Interior probabilities, -those contained within, existing probabilities are interpolated in a manner +those contained within existing probabilities are interpolated in a manner controled by the \code{middle} argument. Those outside existing probabilities are extrapolated under the assumption that the tails of the distribution decays exponentially. Optionally, one may constrain \emph{all} quantiles to be diff --git a/tests/testthat/test-pivot_quantiles.R b/tests/testthat/test-pivot_quantiles.R index 39db31b2f..d32c16499 100644 --- a/tests/testthat/test-pivot_quantiles.R +++ b/tests/testthat/test-pivot_quantiles.R @@ -22,6 +22,11 @@ test_that("pivotting wider still works if there are duplicates", { tb <- tibble(.pred = quantile_pred(rbind(1:3, 1:3), c(.1, .5, .9))) res <- tibble(`0.1` = c(1, 1), `0.5` = c(2, 2), `0.9` = c(3, 3)) expect_equal(tb %>% pivot_quantiles_wider(.pred), res) + res_longer <- tibble( + .pred_value = rep(1:3, 2), + .pred_quantile_level = rep(c(0.1, 0.5, 0.9), 2) + ) + expect_equal(tb %>% pivot_quantiles_longer(.pred), res_longer) }) From 6c5e70f6779c339609a8b4c8953961faf73d40fe Mon Sep 17 00:00:00 2001 From: dsweber2 Date: Wed, 12 Mar 2025 16:18:39 -0500 Subject: [PATCH 20/22] updating for climatological --- NAMESPACE | 5 +- R/climatological_forecaster.R | 2 +- R/layer_threshold_preds.R | 6 +- man/reexports.Rd | 32 +- tests/testthat/_snaps/snapshots.md | 1291 +++++++--------------------- 5 files changed, 356 insertions(+), 980 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 3c59dcb06..939a1f01a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -136,6 +136,7 @@ export(arx_class_epi_workflow) export(arx_classifier) export(arx_fcast_epi_workflow) export(arx_forecaster) +export(as_epi_df) export(as_tibble) export(autoplot) export(bake) @@ -182,6 +183,7 @@ export(layer_quantile_distn) export(layer_residual_quantiles) export(layer_threshold) export(layer_unnest) +export(mutate) export(nested_quantiles) export(new_default_epi_recipe_blueprint) export(new_epi_recipe_blueprint) @@ -200,6 +202,7 @@ export(rename) export(select) export(slather) export(smooth_quantile_reg) +export(snap) export(step_adjust_latency) export(step_climate) export(step_epi_ahead) @@ -282,11 +285,11 @@ importFrom(hardhat,extract_recipe) importFrom(hardhat,quantile_pred) importFrom(hardhat,refresh_blueprint) importFrom(hardhat,run_mold) +importFrom(lifecycle,deprecated) importFrom(lubridate,"%m-%") importFrom(lubridate,leap_year) importFrom(lubridate,month) importFrom(lubridate,yday) -importFrom(lifecycle,deprecated) importFrom(magrittr,"%>%") importFrom(magrittr,extract2) importFrom(recipes,bake) diff --git a/R/climatological_forecaster.R b/R/climatological_forecaster.R index 7df853252..e29d7d4a3 100644 --- a/R/climatological_forecaster.R +++ b/R/climatological_forecaster.R @@ -148,7 +148,7 @@ climatological_forecaster <- function(epi_data, .by = all_of(args_list$quantile_by_key) ) %>% rename(.pred_distn = climate_pred) %>% - mutate(.pred_distn = dist_quantiles(.pred_distn, args_list$quantile_levels)) + mutate(.pred_distn = hardhat::quantile_pred(do.call(rbind, .pred_distn), args_list$quantile_levels)) # combine them together climate_table <- climate_center %>% left_join(climate_quantiles, by = c(".idx", args_list$quantile_by_key)) %>% diff --git a/R/layer_threshold_preds.R b/R/layer_threshold_preds.R index 9acf06725..2f1720301 100644 --- a/R/layer_threshold_preds.R +++ b/R/layer_threshold_preds.R @@ -61,7 +61,11 @@ layer_threshold_new <- -# restrict various objects to the interval [lower, upper] +#' restrict various objects to the interval [lower, upper] +#' @param x the object to restrict +#' @param lower numeric, the lower bound +#' @param upper numeric, the upper bound +#' @param ... unused #' @export #' @keywords internal snap <- function(x, lower, upper, ...) { diff --git a/man/reexports.Rd b/man/reexports.Rd index ab2cf17be..8d3e360f4 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -1,30 +1,29 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/autoplot.R, R/reexports.R +% Please edit documentation in R/autoplot.R, R/reexports-tidymodels.R, +% R/reexports.R \docType{import} \name{reexports} \alias{reexports} \alias{autoplot} -\alias{filter} -\alias{mutate} -\alias{rename} -\alias{select} -\alias{as_epi_df} -\alias{key_colnames} \alias{fit} \alias{forecast} -\alias{tidy} \alias{prep} \alias{bake} \alias{rand_id} -\alias{as_tibble} \alias{tibble} -\alias{pivot_longer} -\alias{pivot_wider} -\alias{unnest} \alias{as_tibble} \alias{tidy} \alias{quantile_pred} \alias{extract_quantile_levels} +\alias{filter} +\alias{mutate} +\alias{rename} +\alias{select} +\alias{as_epi_df} +\alias{key_colnames} +\alias{pivot_longer} +\alias{pivot_wider} +\alias{unnest} \title{Objects exported from other packages} \keyword{internal} \description{ @@ -36,15 +35,16 @@ below to see their documentation. \item{epiprocess}{\code{\link[epiprocess:epi_df]{as_epi_df}}, \code{\link[epiprocess]{key_colnames}}} - \item{generics}{\code{\link[generics]{fit}}, \code{\link[generics]{forecast}}, \code{\link[generics]{tidy}}} + \item{generics}{\code{\link[generics]{fit}}, \code{\link[generics]{fit}}, \code{\link[generics]{forecast}}, \code{\link[generics]{forecast}}, \code{\link[generics]{tidy}}, \code{\link[generics]{tidy}}} \item{ggplot2}{\code{\link[ggplot2]{autoplot}}} - \item{hardhat}{\code{\link[hardhat:quantile_pred]{extract_quantile_levels}}, \code{\link[hardhat]{quantile_pred}}} + \item{hardhat}{\code{\link[hardhat:quantile_pred]{extract_quantile_levels}}, \code{\link[hardhat:quantile_pred]{extract_quantile_levels}}, \code{\link[hardhat]{quantile_pred}}, \code{\link[hardhat]{quantile_pred}}} - \item{recipes}{\code{\link[recipes]{bake}}, \code{\link[recipes]{prep}}, \code{\link[recipes]{rand_id}}} + \item{recipes}{\code{\link[recipes]{bake}}, \code{\link[recipes]{bake}}, \code{\link[recipes]{prep}}, \code{\link[recipes]{prep}}, \code{\link[recipes]{rand_id}}, \code{\link[recipes]{rand_id}}} - \item{tibble}{\code{\link[tibble]{as_tibble}}, \code{\link[tibble]{tibble}}} + \item{tibble}{\code{\link[tibble]{as_tibble}}, \code{\link[tibble]{as_tibble}}, \code{\link[tibble]{tibble}}, \code{\link[tibble]{tibble}}} \item{tidyr}{\code{\link[tidyr]{pivot_longer}}, \code{\link[tidyr]{pivot_wider}}, \code{\link[tidyr]{unnest}}} }} + diff --git a/tests/testthat/_snaps/snapshots.md b/tests/testthat/_snaps/snapshots.md index 78f629171..b2972a8a0 100644 --- a/tests/testthat/_snaps/snapshots.md +++ b/tests/testthat/_snaps/snapshots.md @@ -843,136 +843,61 @@ 64.1929086, 67.80972325, 58.13744405, 63.10147305, 84.3449863, 51.8545645, 66.9333338, 65.8523132, 55.9202576, 64.1234883, 59.50597115, 48.9275239, 64.0481843, 63.45754255, 43.7883142, 65.37832155), - .pred_distn = structure(list(structure(list(values = c(55.01884375, - 61.9936534, 76.8558811, 85.8705552, 95.7238376875, 107.595355333333, - 124.8294820725), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(22.4852324, - 29.46004205, 44.32226975, 53.33694385, 63.1902263375, 75.0617439833333, - 92.2958707225), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(33.03575305, - 40.0105627, 54.8727904, 63.8874645, 73.7407469875, 85.6122646333333, - 102.8463913725), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(31.00572905, - 37.9805387, 52.8427664, 61.8574405, 71.7107229875, 83.5822406333333, - 100.8163673725), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(36.34589965, + .pred_distn = structure(list(c(55.01884375, 61.9936534, 76.8558811, + 85.8705552, 95.7238376875, 107.595355333333, 124.8294820725 + ), c(22.4852324, 29.46004205, 44.32226975, 53.33694385, 63.1902263375, + 75.0617439833333, 92.2958707225), c(33.03575305, 40.0105627, + 54.8727904, 63.8874645, 73.7407469875, 85.6122646333333, + 102.8463913725), c(31.00572905, 37.9805387, 52.8427664, 61.8574405, + 71.7107229875, 83.5822406333333, 100.8163673725), c(36.34589965, 43.3207093, 58.182937, 67.1976111, 77.0508935875, 88.9224112333333, - 106.1565379725), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(27.4126191, - 34.38742875, 49.24965645, 58.26433055, 68.1176130375, 79.9891306833333, - 97.2232574225), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(59.1059257625, - 65.4267824, 80.893949775, 88.512741775, 98.9851218875, 111.446583986667, - 128.951180125), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(26.1435490625, + 106.1565379725), c(27.4126191, 34.38742875, 49.24965645, + 58.26433055, 68.1176130375, 79.9891306833333, 97.2232574225 + ), c(59.1059257625, 65.4267824, 80.893949775, 88.512741775, + 98.9851218875, 111.446583986667, 128.951180125), c(26.1435490625, 32.4644057, 47.931573075, 55.550365075, 66.0227451875, 78.4842072866667, - 95.988803425), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(36.8149959625, - 43.1358526, 58.603019975, 66.221811975, 76.6941920875, 89.1556541866667, - 106.660250325), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(41.8898725625, - 48.2107292, 63.677896575, 71.296688575, 81.7690686875, 94.2305307866667, - 111.735126925), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(37.4322168625, + 95.988803425), c(36.8149959625, 43.1358526, 58.603019975, + 66.221811975, 76.6941920875, 89.1556541866667, 106.660250325 + ), c(41.8898725625, 48.2107292, 63.677896575, 71.296688575, + 81.7690686875, 94.2305307866667, 111.735126925), c(37.4322168625, 43.7530735, 59.220240875, 66.839032875, 77.3114129875, 89.7728750866667, - 107.277471225), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(34.2319594625, - 40.5528161, 56.019983475, 63.638775475, 74.1111555875, 86.5726176866667, - 104.077213825), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(76.597008525, - 83.6285187166667, 89.8466094166667, 96.39787945, 106.5883326375, - 118.488928483333, 139.8972249625), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(36.051994425, 43.0835046166667, 49.3015953166667, - 55.85286535, 66.0433185375, 77.9439143833333, 99.3522108625 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(48.463300925, 55.4948111166667, + 107.277471225), c(34.2319594625, 40.5528161, 56.019983475, + 63.638775475, 74.1111555875, 86.5726176866667, 104.077213825 + ), c(76.597008525, 83.6285187166667, 89.8466094166667, 96.39787945, + 106.5883326375, 118.488928483333, 139.8972249625), c(36.051994425, + 43.0835046166667, 49.3015953166667, 55.85286535, 66.0433185375, + 77.9439143833333, 99.3522108625), c(48.463300925, 55.4948111166667, 61.7129018166667, 68.26417185, 78.4546250375, 90.3552208833333, - 111.7635173625), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(52.080115575, - 59.1116257666667, 65.3297164666667, 71.8809865, 82.0714396875, - 93.9720355333333, 115.3803320125), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(42.407836375, 49.4393465666667, 55.6574372666667, - 62.2087073, 72.3991604875, 84.2997563333333, 105.7080528125 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(47.371865375, 54.4033755666667, - 60.6214662666667, 67.1727363, 77.3631894875, 89.2637853333333, - 110.6720818125), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(75.151683565, - 78.2257355633333, 82.1485257708333, 87.28053515, 96.1483782208333, - 106.438732546667, 113.7276053175), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(42.661261765, 45.7353137633333, 49.6581039708333, - 54.79011335, 63.6579564208333, 73.9483107466667, 81.2371835175 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(57.740031065, 60.8140830633333, - 64.7368732708333, 69.86888265, 78.7367257208333, 89.0270800466667, - 96.3159528175), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(56.659010465, + 111.7635173625), c(52.080115575, 59.1116257666667, 65.3297164666667, + 71.8809865, 82.0714396875, 93.9720355333333, 115.3803320125 + ), c(42.407836375, 49.4393465666667, 55.6574372666667, 62.2087073, + 72.3991604875, 84.2997563333333, 105.7080528125), c(47.371865375, + 54.4033755666667, 60.6214662666667, 67.1727363, 77.3631894875, + 89.2637853333333, 110.6720818125), c(75.151683565, 78.2257355633333, + 82.1485257708333, 87.28053515, 96.1483782208333, 106.438732546667, + 113.7276053175), c(42.661261765, 45.7353137633333, 49.6581039708333, + 54.79011335, 63.6579564208333, 73.9483107466667, 81.2371835175 + ), c(57.740031065, 60.8140830633333, 64.7368732708333, 69.86888265, + 78.7367257208333, 89.0270800466667, 96.3159528175), c(56.659010465, 59.7330624633333, 63.6558526708333, 68.78786205, 77.6557051208333, - 87.9460594466667, 95.2349322175), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(46.726954865, 49.8010068633333, 53.7237970708333, - 58.85580645, 67.7236495208333, 78.0140038466667, 85.3028766175 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(54.930185565, 58.0042375633333, - 61.9270277708333, 67.05903715, 75.9268802208333, 86.2172345466667, - 93.5061073175), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(50.3425070425, - 53.1286383166667, 57.7775218541667, 61.6092566, 68.5981147666667, - 77.2595451983333, 81.44671049), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(39.7640597925, 42.5501910666667, 47.1990746041667, - 51.03080935, 58.0196675166667, 66.6810979483333, 70.86826324 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(54.8847201925, - 57.6708514666667, 62.3197350041667, 66.15146975, 73.1403279166667, - 81.8017583483333, 85.98892364), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(54.2940784425, 57.0802097166667, 61.7290932541667, - 65.560828, 72.5496861666667, 81.2111165983333, 85.39828189 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(34.6248500925, - 37.4109813666667, 42.0598649041667, 45.89159965, 52.8804578166667, - 61.5418882483333, 65.72905354), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(56.2148574425, 59.0009887166667, 63.6498722541667, - 67.481607, 74.4704651666667, 83.1318955983333, 87.31906089 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr"))), class = c("distribution", "vctrs_vctr", - "list"))), row.names = c(NA, -30L), class = c("tbl_df", "tbl", - "data.frame")) + 87.9460594466667, 95.2349322175), c(46.726954865, 49.8010068633333, + 53.7237970708333, 58.85580645, 67.7236495208333, 78.0140038466667, + 85.3028766175), c(54.930185565, 58.0042375633333, 61.9270277708333, + 67.05903715, 75.9268802208333, 86.2172345466667, 93.5061073175 + ), c(50.3425070425, 53.1286383166667, 57.7775218541667, 61.6092566, + 68.5981147666667, 77.2595451983333, 81.44671049), c(39.7640597925, + 42.5501910666667, 47.1990746041667, 51.03080935, 58.0196675166667, + 66.6810979483333, 70.86826324), c(54.8847201925, 57.6708514666667, + 62.3197350041667, 66.15146975, 73.1403279166667, 81.8017583483333, + 85.98892364), c(54.2940784425, 57.0802097166667, 61.7290932541667, + 65.560828, 72.5496861666667, 81.2111165983333, 85.39828189 + ), c(34.6248500925, 37.4109813666667, 42.0598649041667, 45.89159965, + 52.8804578166667, 61.5418882483333, 65.72905354), c(56.2148574425, + 59.0009887166667, 63.6498722541667, 67.481607, 74.4704651666667, + 83.1318955983333, 87.31906089)), quantile_levels = c(0.05, + 0.1, 0.25, 0.5, 0.75, 0.9, 0.95), class = c("quantile_pred", + "vctrs_vctr", "list"))), row.names = c(NA, -30L), class = c("tbl_df", + "tbl", "data.frame")) --- @@ -990,120 +915,47 @@ ), class = "Date"), .pred = c(1782, 927.5, 577.5, 935, 635, 1321, 1791, 934.5, 561, 765.5, 529.5, 1435, 2153.5, 946.5, 607, 673, 476, 1663.5, 2486.5, 1138, 659.5, 637.5, 446.5, 2002, 3236, 1311, - 879.5, 666.5, 446.5, 2964), .pred_distn = structure(list(structure(list( - values = c(512, 651.333333333334, 1098.45833333333, 1678, - 2429.04166666667, 3110.91666666667, 3621.875), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 365.541666666667, 927.5, 2329.29166666667, - 3263.83333333333, 3892.5), quantile_levels = c(0.05, 0.1, - 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(220.125, 253.166666666667, 342, 540.5, 733.375, - 854.166666666667, 977), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(435.375, - 506.583333333333, 567.875, 776, 1103.75, 1465.83333333333, 1673.125 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(312.25, 377.833333333333, 453.416666666667, 584.25, - 726.541666666667, 1037.33333333333, 1516.5), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(149.5, 363.666666666667, 814.333333333333, 1149, - 2003.95833333333, 3254.66666666667, 3883.375), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 450.083333333333, 924.75, 1670.5, 2544.375, - 3821.08333333334, 4407.25), quantile_levels = c(0.05, 0.1, - 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 6.41666666666674, 941.5, 2380.375, 4497.16666666667, - 9047.75), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(118.25, - 198.583333333333, 288.916666666667, 495.75, 736.625, 962, 1521.5 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(313.375, 350.166666666667, 409.083333333333, 597, - 860.791666666666, 1210.41666666667, 1353.25), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(206.75, 258.666666666667, 330.166666666667, 478.75, - 598.041666666667, 734.833333333333, 926.25), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 281.083333333333, 790.666666666667, 1242.5, - 2162.125, 3593.5, 4306.625), quantile_levels = c(0.05, 0.1, - 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 121.916666666668, 1184, 2179.25, 3261.875, - 4614.33333333333, 5419.75), quantile_levels = c(0.05, 0.1, - 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 11, 956, 2619, 8508.83333333334, 10103.25 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 176.25, 306.791666666667, - 570, 839.958333333333, 1568.83333333333, 1901.25), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(238.125, 267.583333333333, 344.291666666667, 511.25, - 760.375, 1021.5, 1195), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(147, - 190.5, 261.458333333333, 414, 545.458333333333, 664.583333333333, - 753.5), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 72.3333333333335, - 931.041666666667, 1487.5, 2731.83333333333, 4390.16666666667, - 5059.5), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(0, 0, 1270.25, 2551, - 4018.70833333333, 5112.83333333333, 6004.375), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 175.541666666667, 1335.5, 4165.625, 8942.58333333333, - 11505.125), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 0, - 321.458333333333, 564.75, 1010.20833333333, 1795, 2183.625), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(225.125, 257.333333333333, - 342.708333333333, 551.25, 724.875, 924.416666666667, 1071.75), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(106.125, 152.083333333333, - 221.166666666667, 363, 513.208333333333, 615.166666666667, 668 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 125.166666666667, 943.833333333333, 1830, 3605.66666666667, - 5259.16666666667, 6957), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 559.25, - 1879.875, 3330.75, 4889, 6122.66666666667, 7629.625), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 0, 158.583333333333, 1687.5, 5516.375, 9507.75, - 12672.375), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(0, 3.41666666666674, - 500.375, 817.000000000001, 1497.16666666667, 2102.08333333333, - 2451.5), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(286.5, 311.333333333333, - 399.166666666667, 629.75, 792.041666666667, 1015, 1111), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(92.125, 139.833333333333, 211.666666666667, 343.75, - 513.208333333333, 626, 714.25), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(0, 579.250000000001, 1838.75, 2963.25, 5057.91666666667, - 6361.33333333333, 7919), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr"))), class = c("distribution", "vctrs_vctr", + 879.5, 666.5, 446.5, 2964), .pred_distn = structure(list(c(512, + 651.333333333334, 1098.45833333333, 1678, 2429.04166666667, 3110.91666666667, + 3621.875), c(0, 0, 365.541666666667, 927.5, 2329.29166666667, + 3263.83333333333, 3892.5), c(220.125, 253.166666666667, 342, + 540.5, 733.375, 854.166666666667, 977), c(435.375, 506.583333333333, + 567.875, 776, 1103.75, 1465.83333333333, 1673.125), c(312.25, + 377.833333333333, 453.416666666667, 584.25, 726.541666666667, + 1037.33333333333, 1516.5), c(149.5, 363.666666666667, 814.333333333333, + 1149, 2003.95833333333, 3254.66666666667, 3883.375), c(0, 450.083333333333, + 924.75, 1670.5, 2544.375, 3821.08333333334, 4407.25), c(0, 0, + 6.41666666666674, 941.5, 2380.375, 4497.16666666667, 9047.75), + c(118.25, 198.583333333333, 288.916666666667, 495.75, 736.625, + 962, 1521.5), c(313.375, 350.166666666667, 409.083333333333, + 597, 860.791666666666, 1210.41666666667, 1353.25), c(206.75, + 258.666666666667, 330.166666666667, 478.75, 598.041666666667, + 734.833333333333, 926.25), c(0, 281.083333333333, 790.666666666667, + 1242.5, 2162.125, 3593.5, 4306.625), c(0, 121.916666666668, + 1184, 2179.25, 3261.875, 4614.33333333333, 5419.75), c(0, + 0, 11, 956, 2619, 8508.83333333334, 10103.25), c(0, 176.25, + 306.791666666667, 570, 839.958333333333, 1568.83333333333, + 1901.25), c(238.125, 267.583333333333, 344.291666666667, + 511.25, 760.375, 1021.5, 1195), c(147, 190.5, 261.458333333333, + 414, 545.458333333333, 664.583333333333, 753.5), c(0, 72.3333333333335, + 931.041666666667, 1487.5, 2731.83333333333, 4390.16666666667, + 5059.5), c(0, 0, 1270.25, 2551, 4018.70833333333, 5112.83333333333, + 6004.375), c(0, 0, 175.541666666667, 1335.5, 4165.625, 8942.58333333333, + 11505.125), c(0, 0, 321.458333333333, 564.75, 1010.20833333333, + 1795, 2183.625), c(225.125, 257.333333333333, 342.708333333333, + 551.25, 724.875, 924.416666666667, 1071.75), c(106.125, 152.083333333333, + 221.166666666667, 363, 513.208333333333, 615.166666666667, + 668), c(0, 125.166666666667, 943.833333333333, 1830, 3605.66666666667, + 5259.16666666667, 6957), c(0, 559.25, 1879.875, 3330.75, + 4889, 6122.66666666667, 7629.625), c(0, 0, 158.583333333333, + 1687.5, 5516.375, 9507.75, 12672.375), c(0, 3.41666666666674, + 500.375, 817.000000000001, 1497.16666666667, 2102.08333333333, + 2451.5), c(286.5, 311.333333333333, 399.166666666667, 629.75, + 792.041666666667, 1015, 1111), c(92.125, 139.833333333333, + 211.666666666667, 343.75, 513.208333333333, 626, 714.25), + c(0, 579.250000000001, 1838.75, 2963.25, 5057.91666666667, + 6361.33333333333, 7919)), quantile_levels = c(0.05, 0.1, + 0.25, 0.5, 0.75, 0.9, 0.95), class = c("quantile_pred", "vctrs_vctr", "list"))), row.names = c(NA, -30L), class = c("tbl_df", "tbl", "data.frame")) @@ -1189,743 +1041,260 @@ 6343, 12383, 5379, 18191, 19727, 9816, 6332, 11972, 5111, 17694, 18581, 9594, 5706, 11492, 5058, 17565, 17672, 9535, 4961, 11209, 4470, 16433, 17077, 8720, 4957, 11119, 4378, 15274), .pred_distn = structure(list( - structure(list(values = c(13505.6, 16257.7333333333, 26529.25, - 38488.5, 47803.5833333333, 52943, 54849.3), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(1798.7, 2451.95, 10271.125, 14631.5, 19124.5416666667, - 37913.2833333333, 77464.75), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2147.4, 3752.65, 6336.54166666667, 9070.75, - 11484.9166666667, 14971.85, 24055.4), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(9205.975, 10792.0333333333, 12938.5, 15369.75, - 26851.9166666667, 51192.7333333333, 74599.425), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(4132.625, 5173.11666666667, 7461.91666666667, - 9054.75, 10303.375, 13200.8666666667, 17771.625), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(8787.125, 9949.68333333333, 12840.2916666667, - 15816.5, 21231.125, 25060.15, 28504.575), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(13359, 17130.6666666667, 28892.9166666667, - 38798, 46440.0833333333, 52838, 54064.5), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(1795, 2370, 10126.25, 14555, 18932.0833333333, - 39212.3333333334, 77512.5), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2529.5, 4030, 7336.5, 9651, 11921.1666666667, - 15999.5, 24553), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(9224.25, + c(13505.6, 16257.7333333333, 26529.25, 38488.5, 47803.5833333333, + 52943, 54849.3), c(1798.7, 2451.95, 10271.125, 14631.5, 19124.5416666667, + 37913.2833333333, 77464.75), c(2147.4, 3752.65, 6336.54166666667, + 9070.75, 11484.9166666667, 14971.85, 24055.4), c(9205.975, + 10792.0333333333, 12938.5, 15369.75, 26851.9166666667, 51192.7333333333, + 74599.425), c(4132.625, 5173.11666666667, 7461.91666666667, + 9054.75, 10303.375, 13200.8666666667, 17771.625), c(8787.125, + 9949.68333333333, 12840.2916666667, 15816.5, 21231.125, 25060.15, + 28504.575), c(13359, 17130.6666666667, 28892.9166666667, + 38798, 46440.0833333333, 52838, 54064.5), c(1795, 2370, 10126.25, + 14555, 18932.0833333333, 39212.3333333334, 77512.5), c(2529.5, + 4030, 7336.5, 9651, 11921.1666666667, 15999.5, 24553), c(9224.25, 10790.3333333333, 12943, 15436.5, 27261.1666666667, 52706.3333333334, - 74960.25), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(4092.25, - 5132.16666666667, 7303.66666666667, 8989.5, 10295.75, 13271.6666666667, - 17869.75), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(9603.5, + 74960.25), c(4092.25, 5132.16666666667, 7303.66666666667, + 8989.5, 10295.75, 13271.6666666667, 17869.75), c(9603.5, 11103.6666666667, 13356.5, 15877, 21436.9166666667, 25184.5, - 28772.25), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(16185.7, - 19338.2, 30417.7916666667, 39255.25, 46966.4166666667, 52746.9333333333, - 54427.7), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(2078.3, - 2575.05, 10845.875, 14696, 19267.7916666667, 40798.3833333333, - 77847.25), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(2702.6, - 4977.35, 7662.25, 9719.75, 12149.25, 16818.15, 24841.6), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(10029.025, 11575.1333333333, - 13744, 16202.25, 28511.875, 55006.4333333333, 76107.575), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(3786.375, 4825.71666666667, + 28772.25), c(16185.7, 19338.2, 30417.7916666667, 39255.25, + 46966.4166666667, 52746.9333333333, 54427.7), c(2078.3, 2575.05, + 10845.875, 14696, 19267.7916666667, 40798.3833333333, 77847.25 + ), c(2702.6, 4977.35, 7662.25, 9719.75, 12149.25, 16818.15, + 24841.6), c(10029.025, 11575.1333333333, 13744, 16202.25, + 28511.875, 55006.4333333333, 76107.575), c(3786.375, 4825.71666666667, 6922.625, 8743.25, 10023.1666666667, 13076.9666666667, 17702.375 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(9716.8, 12099.6166666667, - 13831.75, 16236, 21678.0833333333, 25433.85, 29164.925), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(15758.4, 18701.4, - 30977.3333333333, 38798, 46155.3333333333, 52291.8, 54173.4 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(2361.6, 2780.1, + ), c(9716.8, 12099.6166666667, 13831.75, 16236, 21678.0833333333, + 25433.85, 29164.925), c(15758.4, 18701.4, 30977.3333333333, + 38798, 46155.3333333333, 52291.8, 54173.4), c(2361.6, 2780.1, 11444.8333333333, 14837, 19625.6666666667, 42384.4333333333, - 78182), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(3490.5, 5374.46666666667, - 7847, 10091, 12379, 17636.8, 25130.2), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(9775.8, 11301.9333333333, 13507, 15910, 27131.6666666667, - 56248.5333333333, 76196.9), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3717.5, 4756.26666666667, 7224.66666666667, - 8649.5, 9988.66666666667, 13119.2666666667, 17772), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(11078.7, 12872.3333333333, 14339.6666666667, - 16883, 22316.3333333333, 25971.2, 29845.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(16326.8, 20830.8333333333, 32634.75, 38883.5, - 46655.2083333333, 52755.95, 54634.1), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2433.9, 2774.15, 11421.2083333333, 15058, - 19772.5416666667, 43759.4833333333, 78305.75), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3146.75, 5152.86666666667, 7268.75, 9719.75, - 12133.9166666667, 18015.45, 24978.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(9449.575, 10955.7333333333, 13283, 15523.25, - 24825.1666666666, 57417.6333333333, 76213.225), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(4012.9, 5440.66666666667, 7644.75, 8743.25, - 10057.1666666667, 13264.5666666667, 17944.625), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(7168.225, 12262.5166666667, 14176.6666666667, - 16511, 22391.5833333333, 25945.55, 29963.275), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(17412.3, 22308.8, 34428, 38969, 47155.0833333333, - 53220.1, 55094.8), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(2506.2, - 4444.2, 11594.6666666667, 15279, 19919.4166666667, 45134.5333333333, - 78429.5), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(3243, - 5371.26666666667, 7776.5, 10091, 12361.1666666667, 18834.1, - 25267.4), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(9123.35, - 10609.5333333333, 12954.5, 15136.5, 20226.4166666667, 58586.7333333334, - 76229.55), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(3906.7, - 5242.66666666667, 7866.58333333333, 8649.5, 10022.6666666667, - 13306.8666666667, 18014.25), quantile_levels = c(0.05, 0.1, - 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(5065.8, 10541.3, 14013.6666666667, 16139, - 21698.9166666667, 24836.8, 30080.95), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(16960.25, 23946.75, 34087.8333333333, 38334.5, - 46928.9166666667, 52931.75, 54803), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2427.5, 3658.75, 11472.7916666667, 15058, - 19629.7916666667, 46358.5833333334, 78402.25), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2899.25, 5149.66666666667, 7495.25, 9506.5, - 12163.6666666667, 19212.75, 25116), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(9054.625, 10520.8333333333, 12870.5, 15092.25, - 19622.2916666667, 60013.3333333334, 76503.375), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3747, 4991.16666666667, 7655.29166666667, - 8529.75, 9937.54166666667, 13295.6666666667, 18030.375 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(5186, 10631.25, - 14214.6666666667, 16511, 21953.0833333333, 25051.5, 30486.625 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(16277.2, 23612.3, - 34219.6666666667, 37700, 46755.6666666667, 52643.4, 54511.2 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(2348.8, 2873.3, + 78182), c(3490.5, 5374.46666666667, 7847, 10091, 12379, 17636.8, + 25130.2), c(9775.8, 11301.9333333333, 13507, 15910, 27131.6666666667, + 56248.5333333333, 76196.9), c(3717.5, 4756.26666666667, 7224.66666666667, + 8649.5, 9988.66666666667, 13119.2666666667, 17772), c(11078.7, + 12872.3333333333, 14339.6666666667, 16883, 22316.3333333333, + 25971.2, 29845.6), c(16326.8, 20830.8333333333, 32634.75, + 38883.5, 46655.2083333333, 52755.95, 54634.1), c(2433.9, + 2774.15, 11421.2083333333, 15058, 19772.5416666667, 43759.4833333333, + 78305.75), c(3146.75, 5152.86666666667, 7268.75, 9719.75, + 12133.9166666667, 18015.45, 24978.8), c(9449.575, 10955.7333333333, + 13283, 15523.25, 24825.1666666666, 57417.6333333333, 76213.225 + ), c(4012.9, 5440.66666666667, 7644.75, 8743.25, 10057.1666666667, + 13264.5666666667, 17944.625), c(7168.225, 12262.5166666667, + 14176.6666666667, 16511, 22391.5833333333, 25945.55, 29963.275 + ), c(17412.3, 22308.8, 34428, 38969, 47155.0833333333, 53220.1, + 55094.8), c(2506.2, 4444.2, 11594.6666666667, 15279, 19919.4166666667, + 45134.5333333333, 78429.5), c(3243, 5371.26666666667, 7776.5, + 10091, 12361.1666666667, 18834.1, 25267.4), c(9123.35, 10609.5333333333, + 12954.5, 15136.5, 20226.4166666667, 58586.7333333334, 76229.55 + ), c(3906.7, 5242.66666666667, 7866.58333333333, 8649.5, + 10022.6666666667, 13306.8666666667, 18014.25), c(5065.8, + 10541.3, 14013.6666666667, 16139, 21698.9166666667, 24836.8, + 30080.95), c(16960.25, 23946.75, 34087.8333333333, 38334.5, + 46928.9166666667, 52931.75, 54803), c(2427.5, 3658.75, 11472.7916666667, + 15058, 19629.7916666667, 46358.5833333334, 78402.25), c(2899.25, + 5149.66666666667, 7495.25, 9506.5, 12163.6666666667, 19212.75, + 25116), c(9054.625, 10520.8333333333, 12870.5, 15092.25, + 19622.2916666667, 60013.3333333334, 76503.375), c(3747, 4991.16666666667, + 7655.29166666667, 8529.75, 9937.54166666667, 13295.6666666667, + 18030.375), c(5186, 10631.25, 14214.6666666667, 16511, 21953.0833333333, + 25051.5, 30486.625), c(16277.2, 23612.3, 34219.6666666667, + 37700, 46755.6666666667, 52643.4, 54511.2), c(2348.8, 2873.3, 11338.1666666667, 15017, 19428.8333333333, 47339.3666666666, - 78375), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(2555.5, 4928.06666666667, - 7162, 9117, 11738, 19591.4, 24964.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(8985.9, 10432.1333333333, 12980, 15048, 18340.1666666667, - 61439.9333333333, 76777.2), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3298.3, 4450.66666666667, 7011.66666666667, - 8050, 9489.66666666667, 12995.4666666667, 17757.5), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(5306.2, 10508.4, 14723, 16883, 22316.3333333333, - 25275, 30892.3), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(21211.45, - 28351.35, 35104.7916666667, 37619.5, 46709.625, 52688.85, - 54583.9), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(2345.1, - 2399.5, 11278.5416666667, 14926.5, 19001.6666666667, 32358.8166666666, - 74049.6499999998), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(2289.25, + 78375), c(2555.5, 4928.06666666667, 7162, 9117, 11738, 19591.4, + 24964.6), c(8985.9, 10432.1333333333, 12980, 15048, 18340.1666666667, + 61439.9333333333, 76777.2), c(3298.3, 4450.66666666667, 7011.66666666667, + 8050, 9489.66666666667, 12995.4666666667, 17757.5), c(5306.2, + 10508.4, 14723, 16883, 22316.3333333333, 25275, 30892.3), + c(21211.45, 28351.35, 35104.7916666667, 37619.5, 46709.625, + 52688.85, 54583.9), c(2345.1, 2399.5, 11278.5416666667, 14926.5, + 19001.6666666667, 32358.8166666666, 74049.6499999998), c(2289.25, 4771.45, 6906.25, 8946.5, 10652.625, 19977.2166666667, 24890.7 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(9004.175, 10411.75, - 12967.25, 15034.25, 17727.1666666667, 62772.8333333333, 77138.025 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(2808.6, 3912.01666666667, + ), c(9004.175, 10411.75, 12967.25, 15034.25, 17727.1666666667, + 62772.8333333333, 77138.025), c(2808.6, 3912.01666666667, 6327.04166666667, 7521.5, 8971.58333333333, 12715.05, 17443.625 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(5836.4, 10729.7166666667, - 15191.2916666667, 18142.75, 23089.5833333333, 25927.9166666667, - 31707.975), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(23944.6, + ), c(5836.4, 10729.7166666667, 15191.2916666667, 18142.75, + 23089.5833333333, 25927.9166666667, 31707.975), c(23944.6, 31138.5333333333, 36280.1666666667, 38179, 47104.25, 52733.9, - 54717.6), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(3052.35, - 9589.2, 11699.75, 15017, 19227.6666666667, 34023.7666666667, - 75556.1), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(4574.65, - 4940.86666666667, 7336.5, 9224.5, 11000.25, 20507.3666666667, - 25101.8), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(9577.75, + 54717.6), c(3052.35, 9589.2, 11699.75, 15017, 19227.6666666667, + 34023.7666666667, 75556.1), c(4574.65, 4940.86666666667, + 7336.5, 9224.5, 11000.25, 20507.3666666667, 25101.8), c(9577.75, 10880.7333333333, 13239.8333333333, 15308, 17811.6666666667, - 63744.3333333333, 77498.85), quantile_levels = c(0.05, 0.1, - 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2606.9, 3747.06666666667, 6793.75, 7468, 8860.83333333333, - 12844.2, 17417.75), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(6519.6, + 63744.3333333333, 77498.85), c(2606.9, 3747.06666666667, + 6793.75, 7468, 8860.83333333333, 12844.2, 17417.75), c(6519.6, 10972.3666666667, 15734.9166666667, 19251.5, 24015.8333333333, - 26772.6666666667, 32676.65), quantile_levels = c(0.05, 0.1, - 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(30143.55, 32933, 36254.9166666667, 38288.5, - 45981.375, 51866.35, 54783.025), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(9504.175, 10087.8, 12112.75, 14926.5, 18563.375, - 35687.7166666666, 77061.5499999999), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(5122.3, 5440.33333333333, 7636.75, 9481, 11397.25, - 21089.5166666666, 25364.9), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(9483.625, 10792.0333333333, 13636.5833333333, - 15178.75, 17645.1666666667, 51192.7333333332, 71279.5 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(2699.2, 3876.11666666667, - 7081.375, 7650.5, 9037.66666666667, 13267.35, 17685.875), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(6752.8, 10373.6333333333, - 16482.0416666667, 19689.25, 24420.75, 27167.4166666667, 33195.325 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(30054, 32846.3333333333, - 36222.6666666667, 38118, 44345.5, 51942.5, 54863), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(9602, 10479.6666666667, 11966, 14836, 18000.6666666667, - 37351.6666666666, 78566.9999999998), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(4943, 5436, 7407, 9224.5, 10590, 15999.5, - 23867), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(10402, - 11313.3333333333, 13850.6666666667, 15049.5, 17181.3333333333, - 52619.3333333333, 71699.9999999999), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2497.5, 4747.66666666667, 6887.5, 7468, 8788.33333333333, - 13396.5, 17660), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(6353, - 7303.33333333333, 16575.6666666667, 20127, 24683, 27562.1666666667, - 33714), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(30609, 33678.5333333333, - 36115.4166666667, 38152.5, 44796.5, 51943.65, 54882.775), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(8727.5, 10506.25, - 11801.125, 14298.5, 17316.75, 38593.1166666666, 80240.5749999997 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(5286.75, 5818.43333333333, - 7427.5, 9255, 10477.2083333333, 16246.2, 23904.1), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(10572.9, 11566.1333333333, 13513.9166666667, - 14732.25, 16706.1666666667, 38273.0999999999, 71758.825 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(3500.325, 5164.43333333333, - 6782.58333333333, 7167.5, 8370.08333333333, 12298.8833333333, - 17550.65), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(8782.15, - 9745.23333333333, 18901.7916666667, 23672.5, 27843.3333333333, - 30189.4166666667, 38204.6499999997), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(29822, 33388.7333333333, 35722.6666666667, - 37746, 45086.5, 51783.8, 54741.55), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(7853, 10025.5, 11340, 13761, 16558.5833333333, - 25362.8666666667, 81914.1500000001), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(5095.5, 5582.53333333333, 7253, 8914, 10045.1666666667, - 12628.6, 23801.2), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(10957.1, - 11891.6666666667, 13177.1666666667, 14415, 16394.8333333333, - 19398.1666666667, 71817.65), quantile_levels = c(0.05, 0.1, - 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3087.65, 4791.53333333333, 6409.83333333333, - 6725, 7740.16666666667, 9516.13333333334, 17299.3), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(7598.3, 8574.13333333334, 17622.3333333333, - 22350, 26059.5, 28098, 39082.3000000001), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(32519.95, 33308.7333333333, 35436.1666666667, - 37488.5, 43019.5, 50277.7666666667, 52591.25), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(6840.5, 9406.75, 10705.25, 13314.5, 14638.9583333333, - 18303.3166666667, 43700.7499999999), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(4966.25, 5408.63333333333, 7129.75, 8776.5, - 9930.33333333333, 11747.7666666667, 14690.275), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(10918.65, 11891.1666666667, 13407.9166666667, - 14469.75, 16427.6666666667, 18348.5166666667, 28410.3749999999 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(2910.975, 4654.63333333333, - 6265.375, 6571.5, 7712.58333333333, 8852.8, 11127.4), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(8925.95, 9914.53333333333, 18804.5833333333, - 23309.5, 27544.8333333333, 29565.5, 42471.4499999999), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(31164.6, 32021.5333333333, - 34218.6666666667, 36394, 41517.8333333333, 47717.1333333333, - 49796.3), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(6196, - 9156, 10366, 13007, 13878.6666666667, 17648.3, 20612.7), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(4813, 5210.73333333333, - 6961, 8615, 9759, 10560.0666666667, 11782.5), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(10610.2, 11515.6666666667, 13055.6666666667, - 14137, 16014.3333333333, 16913.2666666667, 18871), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2734.3, 4517.73333333333, 6168.83333333333, - 6499, 7697.33333333333, 8782.4, 9804.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(7477.6, 8478.93333333333, 17148.3333333333, - 22205, 26049, 27669.7333333333, 29791.2), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(27272.6, 28129.5333333333, 30326.6666666667, - 32502, 36595, 42381.4666666667, 45904.3), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(8994, 9834.56666666667, 10853, 13428, 14255.6666666667, - 18330.8666666667, 20967.1), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(4731, 5128.73333333333, 6879, 8533, 9524.33333333333, - 10012.9333333333, 11700.5), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(10609.2, 11514.6666666667, 13054.6666666667, - 14136, 15769, 16912.2666666667, 18870), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2066.3, 3849.73333333333, 5500.83333333333, - 6018, 7084.66666666667, 8114.4, 9136.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(7477.6, 8478.93333333333, 17148.3333333333, - 22350, 26049, 27669.7333333333, 29791.2), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(25775.6, 26632.5333333333, 28829.6666666667, - 30725, 33217, 40884.4666666667, 44407.3), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(8802, 9642.56666666667, 10661, 13007, 13878.6666666667, - 17648.3, 18255.6), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(4731, - 5128.73333333333, 6861, 8533, 9524.33333333333, 10012.9333333333, - 11700.5), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(10484.2, + 26772.6666666667, 32676.65), c(30143.55, 32933, 36254.9166666667, + 38288.5, 45981.375, 51866.35, 54783.025), c(9504.175, 10087.8, + 12112.75, 14926.5, 18563.375, 35687.7166666666, 77061.5499999999 + ), c(5122.3, 5440.33333333333, 7636.75, 9481, 11397.25, 21089.5166666666, + 25364.9), c(9483.625, 10792.0333333333, 13636.5833333333, + 15178.75, 17645.1666666667, 51192.7333333332, 71279.5), c(2699.2, + 3876.11666666667, 7081.375, 7650.5, 9037.66666666667, 13267.35, + 17685.875), c(6752.8, 10373.6333333333, 16482.0416666667, + 19689.25, 24420.75, 27167.4166666667, 33195.325), c(30054, + 32846.3333333333, 36222.6666666667, 38118, 44345.5, 51942.5, + 54863), c(9602, 10479.6666666667, 11966, 14836, 18000.6666666667, + 37351.6666666666, 78566.9999999998), c(4943, 5436, 7407, + 9224.5, 10590, 15999.5, 23867), c(10402, 11313.3333333333, + 13850.6666666667, 15049.5, 17181.3333333333, 52619.3333333333, + 71699.9999999999), c(2497.5, 4747.66666666667, 6887.5, 7468, + 8788.33333333333, 13396.5, 17660), c(6353, 7303.33333333333, + 16575.6666666667, 20127, 24683, 27562.1666666667, 33714), + c(30609, 33678.5333333333, 36115.4166666667, 38152.5, 44796.5, + 51943.65, 54882.775), c(8727.5, 10506.25, 11801.125, 14298.5, + 17316.75, 38593.1166666666, 80240.5749999997), c(5286.75, + 5818.43333333333, 7427.5, 9255, 10477.2083333333, 16246.2, + 23904.1), c(10572.9, 11566.1333333333, 13513.9166666667, + 14732.25, 16706.1666666667, 38273.0999999999, 71758.825), + c(3500.325, 5164.43333333333, 6782.58333333333, 7167.5, 8370.08333333333, + 12298.8833333333, 17550.65), c(8782.15, 9745.23333333333, + 18901.7916666667, 23672.5, 27843.3333333333, 30189.4166666667, + 38204.6499999997), c(29822, 33388.7333333333, 35722.6666666667, + 37746, 45086.5, 51783.8, 54741.55), c(7853, 10025.5, 11340, + 13761, 16558.5833333333, 25362.8666666667, 81914.1500000001 + ), c(5095.5, 5582.53333333333, 7253, 8914, 10045.1666666667, + 12628.6, 23801.2), c(10957.1, 11891.6666666667, 13177.1666666667, + 14415, 16394.8333333333, 19398.1666666667, 71817.65), c(3087.65, + 4791.53333333333, 6409.83333333333, 6725, 7740.16666666667, + 9516.13333333334, 17299.3), c(7598.3, 8574.13333333334, 17622.3333333333, + 22350, 26059.5, 28098, 39082.3000000001), c(32519.95, 33308.7333333333, + 35436.1666666667, 37488.5, 43019.5, 50277.7666666667, 52591.25 + ), c(6840.5, 9406.75, 10705.25, 13314.5, 14638.9583333333, + 18303.3166666667, 43700.7499999999), c(4966.25, 5408.63333333333, + 7129.75, 8776.5, 9930.33333333333, 11747.7666666667, 14690.275 + ), c(10918.65, 11891.1666666667, 13407.9166666667, 14469.75, + 16427.6666666667, 18348.5166666667, 28410.3749999999), c(2910.975, + 4654.63333333333, 6265.375, 6571.5, 7712.58333333333, 8852.8, + 11127.4), c(8925.95, 9914.53333333333, 18804.5833333333, + 23309.5, 27544.8333333333, 29565.5, 42471.4499999999), c(31164.6, + 32021.5333333333, 34218.6666666667, 36394, 41517.8333333333, + 47717.1333333333, 49796.3), c(6196, 9156, 10366, 13007, 13878.6666666667, + 17648.3, 20612.7), c(4813, 5210.73333333333, 6961, 8615, + 9759, 10560.0666666667, 11782.5), c(10610.2, 11515.6666666667, + 13055.6666666667, 14137, 16014.3333333333, 16913.2666666667, + 18871), c(2734.3, 4517.73333333333, 6168.83333333333, 6499, + 7697.33333333333, 8782.4, 9804.8), c(7477.6, 8478.93333333333, + 17148.3333333333, 22205, 26049, 27669.7333333333, 29791.2 + ), c(27272.6, 28129.5333333333, 30326.6666666667, 32502, + 36595, 42381.4666666667, 45904.3), c(8994, 9834.56666666667, + 10853, 13428, 14255.6666666667, 18330.8666666667, 20967.1 + ), c(4731, 5128.73333333333, 6879, 8533, 9524.33333333333, + 10012.9333333333, 11700.5), c(10609.2, 11514.6666666667, + 13054.6666666667, 14136, 15769, 16912.2666666667, 18870), + c(2066.3, 3849.73333333333, 5500.83333333333, 6018, 7084.66666666667, + 8114.4, 9136.8), c(7477.6, 8478.93333333333, 17148.3333333333, + 22350, 26049, 27669.7333333333, 29791.2), c(25775.6, 26632.5333333333, + 28829.6666666667, 30725, 33217, 40884.4666666667, 44407.3 + ), c(8802, 9642.56666666667, 10661, 13007, 13878.6666666667, + 17648.3, 18255.6), c(4731, 5128.73333333333, 6861, 8533, + 9524.33333333333, 10012.9333333333, 11700.5), c(10484.2, 11389.6666666667, 12929.6666666667, 13997, 15644, 16787.2666666667, - 18745), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(2020.3, 3803.73333333333, - 5559, 5972, 7038.66666666667, 8068.4, 9090.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(7477.6, 9930.13333333334, 17199.3333333333, - 22350, 26049, 27669.7333333333, 29791.2), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(22459.4, 23246.3333333333, 24843.6666666667, - 26739, 29231, 36898.4666666667, 40421.3), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(9153.2, 9642.56666666667, 10661, 13007, 13878.6666666667, - 17648.3, 18255.6), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(4848.6, - 5776.73333333333, 6861, 8533, 9524.33333333333, 10012.9333333333, - 11700.5), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(10881.8, + 18745), c(2020.3, 3803.73333333333, 5559, 5972, 7038.66666666667, + 8068.4, 9090.8), c(7477.6, 9930.13333333334, 17199.3333333333, + 22350, 26049, 27669.7333333333, 29791.2), c(22459.4, 23246.3333333333, + 24843.6666666667, 26739, 29231, 36898.4666666667, 40421.3 + ), c(9153.2, 9642.56666666667, 10661, 13007, 13878.6666666667, + 17648.3, 18255.6), c(4848.6, 5776.73333333333, 6861, 8533, + 9524.33333333333, 10012.9333333333, 11700.5), c(10881.8, 12145.2, 12929.6666666667, 13997, 15644, 16787.2666666667, - 18745), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(3192.3, 4022.2, - 5559, 5972, 7038.66666666667, 8068.4, 9090.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(10253.6, 12706.1333333333, 19975.3333333333, - 25706, 29214.3333333333, 31033, 38341.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(22387.4, 23065, 24717.6666666667, 26667, 29159, - 36826.4666666667, 40349.3), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(9153.2, 9828.53333333333, 10712, 13236, 14046.6666666667, - 17648.3, 18255.6), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(5472.2, + 18745), c(3192.3, 4022.2, 5559, 5972, 7038.66666666667, 8068.4, + 9090.8), c(10253.6, 12706.1333333333, 19975.3333333333, 25706, + 29214.3333333333, 31033, 38341.6), c(22387.4, 23065, 24717.6666666667, + 26667, 29159, 36826.4666666667, 40349.3), c(9153.2, 9828.53333333333, + 10712, 13236, 14046.6666666667, 17648.3, 18255.6), c(5472.2, 6260.8, 6934, 8533, 9524.33333333333, 10012.9333333333, 11700.5 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(11600.6, 12145.2, - 12929.6666666667, 13997, 15644, 16787.2666666667, 18745), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(3931.2, 4163.66666666667, - 5559, 5972, 7038.66666666667, 8068.4, 9090.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(10483.6, 12936.1333333333, 20205.3333333333, - 26048, 30210.6666666667, 31670.8, 38571.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(21345.4, 22418.3333333333, 23729.6666666667, - 25625, 28117, 35784.4666666667, 39307.3), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(8948.2, 9623.53333333333, 10507, 12802, 13841.6666666667, - 17443.3, 18050.6), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(5090.2, - 5878.8, 6552, 8120, 9142.33333333333, 9630.93333333333, 11318.5 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(11098, 11842.3333333333, - 12929.6666666667, 13997, 15644, 16787.2666666667, 18745), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(3899.2, 4131.66666666667, + ), c(11600.6, 12145.2, 12929.6666666667, 13997, 15644, 16787.2666666667, + 18745), c(3931.2, 4163.66666666667, 5559, 5972, 7038.66666666667, + 8068.4, 9090.8), c(10483.6, 12936.1333333333, 20205.3333333333, + 26048, 30210.6666666667, 31670.8, 38571.6), c(21345.4, 22418.3333333333, + 23729.6666666667, 25625, 28117, 35784.4666666667, 39307.3 + ), c(8948.2, 9623.53333333333, 10507, 12802, 13841.6666666667, + 17443.3, 18050.6), c(5090.2, 5878.8, 6552, 8120, 9142.33333333333, + 9630.93333333333, 11318.5), c(11098, 11842.3333333333, 12929.6666666667, + 13997, 15644, 16787.2666666667, 18745), c(3899.2, 4131.66666666667, 5500.33333333333, 5753, 7006.66666666667, 8036.4, 9058.8), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(10253.6, 12706.1333333333, - 19975.3333333333, 25818, 29214.3333333333, 31033, 33266.4 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(20870.4, 21943.3333333333, - 23254.6666666667, 25150, 27642, 35309.4666666667, 38832.3 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(8610.2, 9285.53333333333, - 10169, 11576, 13335.6666666667, 17105.3, 17712.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(5033.2, 5821.8, 6850, 8094, 9179.33333333333, - 9573.93333333333, 11261.5), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(11009, 11228.6666666667, 12538.3333333333, - 13863, 15555, 16698.2666666667, 18656), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3776.2, 4008.66666666667, 5284, 5549, 6725.66666666667, - 7913.4, 8935.8), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(7477.6, - 9930.13333333334, 17199.3333333333, 22930, 26049, 28257, - 30490.4), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(19821.4, + c(10253.6, 12706.1333333333, 19975.3333333333, 25818, 29214.3333333333, + 31033, 33266.4), c(20870.4, 21943.3333333333, 23254.6666666667, + 25150, 27642, 35309.4666666667, 38832.3), c(8610.2, 9285.53333333333, + 10169, 11576, 13335.6666666667, 17105.3, 17712.6), c(5033.2, + 5821.8, 6850, 8094, 9179.33333333333, 9573.93333333333, 11261.5 + ), c(11009, 11228.6666666667, 12538.3333333333, 13863, 15555, + 16698.2666666667, 18656), c(3776.2, 4008.66666666667, 5284, + 5549, 6725.66666666667, 7913.4, 8935.8), c(7477.6, 9930.13333333334, + 17199.3333333333, 22930, 26049, 28257, 30490.4), c(19821.4, 20894.3333333333, 22205.6666666667, 23879, 25537.3333333333, - 32287, 35424.1), quantile_levels = c(0.05, 0.1, 0.25, 0.5, - 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(8577.2, - 9252.53333333333, 10136, 11543, 13302.6666666667, 16077.6666666667, - 17451.2), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(4858.2, - 5646.8, 6675, 7919, 9004.33333333333, 9398.93333333333, 11086.5 - ), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95 - )), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(10725, 10944.6666666667, - 12245.6666666667, 13414, 15162.3333333333, 16256.1333333333, - 18372), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(3746.2, 3978.66666666667, - 5254, 5519, 6695.66666666667, 7883.4, 8905.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(7015.6, 9468.13333333334, 16737.3333333333, - 21888, 24995.3333333333, 27790.7333333333, 30028.4), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(19739.4, 20812.3333333333, - 22123.6666666667, 23797, 25455.3333333333, 29471.8333333333, - 33457.4), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(8457.2, + 32287, 35424.1), c(8577.2, 9252.53333333333, 10136, 11543, + 13302.6666666667, 16077.6666666667, 17451.2), c(4858.2, 5646.8, + 6675, 7919, 9004.33333333333, 9398.93333333333, 11086.5), + c(10725, 10944.6666666667, 12245.6666666667, 13414, 15162.3333333333, + 16256.1333333333, 18372), c(3746.2, 3978.66666666667, 5254, + 5519, 6695.66666666667, 7883.4, 8905.8), c(7015.6, 9468.13333333334, + 16737.3333333333, 21888, 24995.3333333333, 27790.7333333333, + 30028.4), c(19739.4, 20812.3333333333, 22123.6666666667, + 23797, 25455.3333333333, 29471.8333333333, 33457.4), c(8457.2, 9132.53333333333, 10016, 11423, 13064.6666666667, 14882.3333333333, - 16487.6), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(4756.2, - 5544.8, 6573, 7817, 8785, 9005.33333333333, 9658), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(10266, 10485.6666666667, 11786.6666666667, - 12955, 14703.3333333333, 15439.2666666667, 16501.4), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(3690.2, 3922.66666666667, + 16487.6), c(4756.2, 5544.8, 6573, 7817, 8785, 9005.33333333333, + 9658), c(10266, 10485.6666666667, 11786.6666666667, 12955, + 14703.3333333333, 15439.2666666667, 16501.4), c(3690.2, 3922.66666666667, 5198, 5463, 6255.33333333333, 7378.46666666667, 8258.6), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(6967.6, 9420.13333333334, - 16689.3333333333, 21695, 24506.6666666667, 27742.7333333333, - 29980.4), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, - 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(17730.4, - 18803.3333333333, 20114.6666666667, 21531, 23113, 26977, - 28232), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(8127.2, 8802.53333333333, - 9686, 11042, 12587, 14552.3333333333, 16157.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3962.2, 4750.8, 5779, 6992, 7636.66666666667, - 8200.53333333333, 8292.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(10207, 10426.6666666667, 11727.6666666667, - 12896, 14513, 15178.4666666667, 16052), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3611.2, 3843.66666666667, 5119, 5384, 6039.33333333333, - 6873.33333333333, 7838.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(6094.6, 8547.13333333334, 15152, 20127, 23361.1666666667, - 26869.7333333333, 29107.4), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(17030.4, 18103.3333333333, 19360.6666666667, - 20459, 22413, 26277, 27532), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(8010.2, 8685.53333333333, 9518, 10925, 12470, - 14435.3333333333, 16040.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3788.2, 4576.8, 5325.33333333333, 6818, 7462.66666666667, - 8026.53333333333, 8118.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(10036, 10255.6666666667, 11556.6666666667, - 12725, 14080.3333333333, 15007.4666666667, 15881), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3493.2, 3725.66666666667, 4809, 5266, 5921.33333333333, - 6755.33333333333, 7720.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(6094.6, 8547.13333333334, 14977.6666666667, - 20127, 23361.1666666667, 26869.7333333333, 29107.4), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(16349.4, 17422.3333333333, - 18679.6666666667, 19778, 21732, 25596, 26851), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(7567.2, 8242.53333333333, 9379.66666666667, - 10482, 12027, 13992.3333333333, 15597.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3747.2, 4535.8, 5711.33333333333, 6777, 7421.66666666667, - 7985.53333333333, 8077.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(9698, 9917.66666666667, 11218.6666666667, - 12387, 13742.3333333333, 14669.4666666667, 15543), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3670.6, 3908, 5001, 5347, 6121.66666666667, - 6755.33333333333, 7720.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(6094.6, 8547.13333333334, 15152, 20127, 23361.1666666667, - 26869.7333333333, 29107.4), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(16298.4, 17371.3333333333, 18628.6666666667, - 19727, 21681, 25545, 26800), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(6850.2, 7525.53333333333, 8662.66666666667, - 9765, 11235, 13275.3333333333, 14880.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3736.2, 4524.8, 5700.33333333333, 6714, 7410.66666666667, - 7974.53333333333, 8066.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(9287, 9506.66666666667, 10599, 11883, 13331.3333333333, - 14258.4666666667, 15132), quantile_levels = c(0.05, 0.1, - 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3402.6, 3640, 4733, 4998, 5853.66666666667, - 6487.33333333333, 7452.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(5597.6, 8050.13333333334, 14655, 19574, 21943, - 26372.7333333333, 28610.4), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(15152.4, 16225.3333333333, 17482.6666666667, - 18581, 20535, 24399, 25654), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(6628.2, 7303.53333333333, 8440.66666666667, - 9543, 11013, 13053.3333333333, 14658.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3110.2, 3898.8, 5074.33333333333, 6140, 6784.66666666667, - 7348.53333333333, 7440.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(8807, 9026.66666666667, 10119, 11403, 13193.3333333333, - 13778.4666666667, 14652), quantile_levels = c(0.05, 0.1, - 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3349.6, 3587, 4680, 4945, 5712.66666666667, - 6263.53333333333, 7399.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(5468.6, 7921.13333333334, 14526, 19172, 21297.6666666667, - 26243.7333333333, 28481.4), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(14243.4, 15316.3333333333, 16573.6666666667, - 17672, 19117.3333333333, 21921.5333333333, 24647), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(6569.2, 7244.53333333333, 8381.66666666667, - 9484, 10946.6666666667, 12994.3333333333, 14599.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2365.2, 3153.8, 4329.33333333333, 5343, 6039.66666666667, - 6603.53333333333, 6695.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(8524, 8743.66666666667, 9836, 11120, 12910.3333333333, - 13495.4666666667, 14369), quantile_levels = c(0.05, 0.1, - 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2761.6, 2999, 4092, 4438, 5124.66666666667, - 5675.53333333333, 6811.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(4336.6, 6789.13333333334, 13394, 17898, 20165.6666666667, - 25111.7333333333, 27349.4), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(13648.4, 14721.3333333333, 15978.6666666667, - 17077, 18266, 19933.0666666667, 22864), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(5754.2, 6429.53333333333, 7566.66666666667, - 8669, 10050.3333333333, 10882.4, 13120.6), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(2361.2, 3149.8, 4325.33333333333, 5270, 5878.66666666667, - 6580.4, 6683.8), quantile_levels = c(0.05, 0.1, 0.25, - 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", "dist_default", - "vctrs_rcrd", "vctrs_vctr")), structure(list(values = c(8434, - 8653.66666666667, 9746, 11030, 12458, 13329.8, 13463.8), - quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, - 0.95)), class = c("dist_quantiles", "dist_default", "vctrs_rcrd", - "vctrs_vctr")), structure(list(values = c(2669.6, 2907, 4000, - 4346, 5032.66666666667, 5583.53333333333, 6719.8), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr")), structure(list( - values = c(3177.6, 5630.13333333334, 12235, 16653, 18812.6666666667, - 23952.7333333333, 26190.4), quantile_levels = c(0.05, - 0.1, 0.25, 0.5, 0.75, 0.9, 0.95)), class = c("dist_quantiles", - "dist_default", "vctrs_rcrd", "vctrs_vctr"))), class = c("distribution", - "vctrs_vctr", "list"))), row.names = c(NA, -186L), class = c("tbl_df", - "tbl", "data.frame")) + c(6967.6, 9420.13333333334, 16689.3333333333, 21695, 24506.6666666667, + 27742.7333333333, 29980.4), c(17730.4, 18803.3333333333, + 20114.6666666667, 21531, 23113, 26977, 28232), c(8127.2, + 8802.53333333333, 9686, 11042, 12587, 14552.3333333333, 16157.6 + ), c(3962.2, 4750.8, 5779, 6992, 7636.66666666667, 8200.53333333333, + 8292.8), c(10207, 10426.6666666667, 11727.6666666667, 12896, + 14513, 15178.4666666667, 16052), c(3611.2, 3843.66666666667, + 5119, 5384, 6039.33333333333, 6873.33333333333, 7838.8), + c(6094.6, 8547.13333333334, 15152, 20127, 23361.1666666667, + 26869.7333333333, 29107.4), c(17030.4, 18103.3333333333, + 19360.6666666667, 20459, 22413, 26277, 27532), c(8010.2, + 8685.53333333333, 9518, 10925, 12470, 14435.3333333333, 16040.6 + ), c(3788.2, 4576.8, 5325.33333333333, 6818, 7462.66666666667, + 8026.53333333333, 8118.8), c(10036, 10255.6666666667, 11556.6666666667, + 12725, 14080.3333333333, 15007.4666666667, 15881), c(3493.2, + 3725.66666666667, 4809, 5266, 5921.33333333333, 6755.33333333333, + 7720.8), c(6094.6, 8547.13333333334, 14977.6666666667, 20127, + 23361.1666666667, 26869.7333333333, 29107.4), c(16349.4, + 17422.3333333333, 18679.6666666667, 19778, 21732, 25596, + 26851), c(7567.2, 8242.53333333333, 9379.66666666667, 10482, + 12027, 13992.3333333333, 15597.6), c(3747.2, 4535.8, 5711.33333333333, + 6777, 7421.66666666667, 7985.53333333333, 8077.8), c(9698, + 9917.66666666667, 11218.6666666667, 12387, 13742.3333333333, + 14669.4666666667, 15543), c(3670.6, 3908, 5001, 5347, 6121.66666666667, + 6755.33333333333, 7720.8), c(6094.6, 8547.13333333334, 15152, + 20127, 23361.1666666667, 26869.7333333333, 29107.4), c(16298.4, + 17371.3333333333, 18628.6666666667, 19727, 21681, 25545, + 26800), c(6850.2, 7525.53333333333, 8662.66666666667, 9765, + 11235, 13275.3333333333, 14880.6), c(3736.2, 4524.8, 5700.33333333333, + 6714, 7410.66666666667, 7974.53333333333, 8066.8), c(9287, + 9506.66666666667, 10599, 11883, 13331.3333333333, 14258.4666666667, + 15132), c(3402.6, 3640, 4733, 4998, 5853.66666666667, 6487.33333333333, + 7452.8), c(5597.6, 8050.13333333334, 14655, 19574, 21943, + 26372.7333333333, 28610.4), c(15152.4, 16225.3333333333, + 17482.6666666667, 18581, 20535, 24399, 25654), c(6628.2, + 7303.53333333333, 8440.66666666667, 9543, 11013, 13053.3333333333, + 14658.6), c(3110.2, 3898.8, 5074.33333333333, 6140, 6784.66666666667, + 7348.53333333333, 7440.8), c(8807, 9026.66666666667, 10119, + 11403, 13193.3333333333, 13778.4666666667, 14652), c(3349.6, + 3587, 4680, 4945, 5712.66666666667, 6263.53333333333, 7399.8 + ), c(5468.6, 7921.13333333334, 14526, 19172, 21297.6666666667, + 26243.7333333333, 28481.4), c(14243.4, 15316.3333333333, + 16573.6666666667, 17672, 19117.3333333333, 21921.5333333333, + 24647), c(6569.2, 7244.53333333333, 8381.66666666667, 9484, + 10946.6666666667, 12994.3333333333, 14599.6), c(2365.2, 3153.8, + 4329.33333333333, 5343, 6039.66666666667, 6603.53333333333, + 6695.8), c(8524, 8743.66666666667, 9836, 11120, 12910.3333333333, + 13495.4666666667, 14369), c(2761.6, 2999, 4092, 4438, 5124.66666666667, + 5675.53333333333, 6811.8), c(4336.6, 6789.13333333334, 13394, + 17898, 20165.6666666667, 25111.7333333333, 27349.4), c(13648.4, + 14721.3333333333, 15978.6666666667, 17077, 18266, 19933.0666666667, + 22864), c(5754.2, 6429.53333333333, 7566.66666666667, 8669, + 10050.3333333333, 10882.4, 13120.6), c(2361.2, 3149.8, 4325.33333333333, + 5270, 5878.66666666667, 6580.4, 6683.8), c(8434, 8653.66666666667, + 9746, 11030, 12458, 13329.8, 13463.8), c(2669.6, 2907, 4000, + 4346, 5032.66666666667, 5583.53333333333, 6719.8), c(3177.6, + 5630.13333333334, 12235, 16653, 18812.6666666667, 23952.7333333333, + 26190.4)), quantile_levels = c(0.05, 0.1, 0.25, 0.5, 0.75, + 0.9, 0.95), class = c("quantile_pred", "vctrs_vctr", "list"))), row.names = c(NA, + -186L), class = c("tbl_df", "tbl", "data.frame")) From c3f0c776a0992a312e271cc115a5e8031814547d Mon Sep 17 00:00:00 2001 From: dsweber2 Date: Wed, 12 Mar 2025 16:35:12 -0500 Subject: [PATCH 21/22] neglected docs --- man/epiweek_leap.Rd | 12 ++++++++++++ man/isoweek_leap.Rd | 12 ++++++++++++ man/snap.Rd | 21 +++++++++++++++++++++ man/yday_leap.Rd | 14 ++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 man/epiweek_leap.Rd create mode 100644 man/isoweek_leap.Rd create mode 100644 man/snap.Rd create mode 100644 man/yday_leap.Rd diff --git a/man/epiweek_leap.Rd b/man/epiweek_leap.Rd new file mode 100644 index 000000000..4fecbf2ca --- /dev/null +++ b/man/epiweek_leap.Rd @@ -0,0 +1,12 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/step_climate.R +\name{epiweek_leap} +\alias{epiweek_leap} +\title{epiweek, but it assigns week 53 the value of 999 instead so it mirrors the assignments in yday_leap} +\usage{ +epiweek_leap(time_value) +} +\description{ +epiweek, but it assigns week 53 the value of 999 instead so it mirrors the assignments in yday_leap +} +\keyword{internal} diff --git a/man/isoweek_leap.Rd b/man/isoweek_leap.Rd new file mode 100644 index 000000000..355d27b1e --- /dev/null +++ b/man/isoweek_leap.Rd @@ -0,0 +1,12 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/step_climate.R +\name{isoweek_leap} +\alias{isoweek_leap} +\title{isoweek, but it assigns week 53 the value of 999 instead so it mirrors the assignments in yday_leap} +\usage{ +isoweek_leap(time_value) +} +\description{ +isoweek, but it assigns week 53 the value of 999 instead so it mirrors the assignments in yday_leap +} +\keyword{internal} diff --git a/man/snap.Rd b/man/snap.Rd new file mode 100644 index 000000000..2f5ca57d5 --- /dev/null +++ b/man/snap.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layer_threshold_preds.R +\name{snap} +\alias{snap} +\title{restrict various objects to the interval \link{lower, upper}} +\usage{ +snap(x, lower, upper, ...) +} +\arguments{ +\item{x}{the object to restrict} + +\item{lower}{numeric, the lower bound} + +\item{upper}{numeric, the upper bound} + +\item{...}{unused} +} +\description{ +restrict various objects to the interval \link{lower, upper} +} +\keyword{internal} diff --git a/man/yday_leap.Rd b/man/yday_leap.Rd new file mode 100644 index 000000000..1dc873a38 --- /dev/null +++ b/man/yday_leap.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/step_climate.R +\name{yday_leap} +\alias{yday_leap} +\title{a function that assigns Feb 29th to 999, and aligns all other dates the same +number in the year, regardless of whether it's a leap year} +\usage{ +yday_leap(time_value) +} +\description{ +a function that assigns Feb 29th to 999, and aligns all other dates the same +number in the year, regardless of whether it's a leap year +} +\keyword{internal} From 8387aa2633dad5a6d985ef8617ff0bfe1af8a31e Mon Sep 17 00:00:00 2001 From: dsweber2 Date: Wed, 12 Mar 2025 16:50:26 -0500 Subject: [PATCH 22/22] no accidental link --- R/layer_threshold_preds.R | 2 +- man/snap.Rd | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/layer_threshold_preds.R b/R/layer_threshold_preds.R index 2f1720301..2869fff07 100644 --- a/R/layer_threshold_preds.R +++ b/R/layer_threshold_preds.R @@ -61,7 +61,7 @@ layer_threshold_new <- -#' restrict various objects to the interval [lower, upper] +#' restrict various objects to the interval \[lower, upper\] #' @param x the object to restrict #' @param lower numeric, the lower bound #' @param upper numeric, the upper bound diff --git a/man/snap.Rd b/man/snap.Rd index 2f5ca57d5..abe4421e8 100644 --- a/man/snap.Rd +++ b/man/snap.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/layer_threshold_preds.R \name{snap} \alias{snap} -\title{restrict various objects to the interval \link{lower, upper}} +\title{restrict various objects to the interval [lower, upper]} \usage{ snap(x, lower, upper, ...) } @@ -16,6 +16,6 @@ snap(x, lower, upper, ...) \item{...}{unused} } \description{ -restrict various objects to the interval \link{lower, upper} +restrict various objects to the interval [lower, upper] } \keyword{internal}