eval_quantile | R Documentation |
Access a distribution's quantiles.
eval_quantile(distribution, at)
enframe_quantile(..., at, arg_name = ".arg", fn_prefix = "quantile", sep = "_")
distribution , ... |
A distribution, or possibly multiple
distributions in the case of |
at |
Vector of values to evaluate the representation at. |
arg_name |
For |
fn_prefix |
For |
sep |
When |
When a quantile function does not exist, an algorithm is deployed that calculates the left inverse of the CDF. This algorithm works by progressively cutting the specified range in half, moving into the left or right half depending on where the solution is. The algorithm is not currently fast and is subject to improvement, and is a simple idea that has been passed around on the internet here and there. Tolerance is less than 1e-9, unless the maximum number of iterations (200) is reached.
The evaluated representation in vector form (for eval_
)
with length matching the length of at
, and data frame
or tibble form (for enframe_
) with number of rows matching the
length of at
. The at
input occupies the first column,
named .arg
by default, or the specification in arg_name
;
the evaluated representations for each distribution in ...
go in the subsequent columns (one column per distribution). For a
single distribution, this column is named according to the
representation by default (cdf, survival, quantile, etc.),
or the value in fn_prefix
. For multiple distributions, unnamed
distributions are auto-named, and columns are named
<fn_prefix><sep><distribution_name>
(e.g., cdf_distribution1
).
Other distributional representations:
eval_cdf()
,
eval_chf()
,
eval_density()
,
eval_hazard()
,
eval_odds()
,
eval_pmf()
,
eval_return()
,
eval_survival()
d <- dst_unif(0, 4)
eval_quantile(d, at = 1:9 / 10)
enframe_quantile(d, at = 1:9 / 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.