extrapolate_quantiles: Summarize a distribution with a set of quantiles

View source: R/extrapolate_quantiles.R

extrapolate_quantilesR Documentation

Summarize a distribution with a set of quantiles

Description

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.

Usage

extrapolate_quantiles(x, probs, replace_na = TRUE, ...)

Arguments

x

A vector of class quantile_pred.

probs

a vector of probabilities at which to calculate quantiles

replace_na

logical. If x contains NA's, these are imputed if possible (if TRUE) or retained (if FALSE).

...

additional arguments passed on to the quantile method

Value

a quantile_pred vector. Each element of x will now have a superset of the original quantile_values (the union of those and probs).

Examples

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)))

cmu-delphi/epipredict documentation built on June 14, 2025, 2:41 a.m.