Skip to contents

Access a distribution's cumulative distribution function (cdf).

Usage

eval_cdf(distribution, at)

enframe_cdf(..., at, arg_name = ".arg", fn_prefix = "cdf", sep = "_")

Arguments

distribution, ...

A distribution, or possibly multiple distributions in the case of ....

at

Vector of values to evaluate the cdf at. Must be named when using in enframe_.

arg_name

For enframe_, name of the column containing the function arguments.

fn_prefix

For enframe_, name of the function to appear in the column(s).

sep

When enframe'ing more than one distribution, the character that will be separating the fn_name and the distribution name.

Value

The evaluated cdf in vector form (for eval_) and data frame or tibble form (for enframe_).

See also

Other distributional representations: eval_chf(), eval_density(), eval_hazard(), eval_odds(), eval_pmf(), eval_quantile(), eval_return(), eval_survival()

Examples

d1 <- dst_unif(0, 4)
d2 <- dst_pois(1.1)
eval_cdf(d1, at = 0:4)
#> [1] 0.00 0.25 0.50 0.75 1.00
enframe_cdf(d1, at = 0:4)
#> # A tibble: 5 × 2
#>    .arg   cdf
#>   <int> <dbl>
#> 1     0  0   
#> 2     1  0.25
#> 3     2  0.5 
#> 4     3  0.75
#> 5     4  1   
enframe_cdf(d1, d2, at = 0:4)
#> # A tibble: 5 × 3
#>    .arg cdf_d1 cdf_d2
#>   <int>  <dbl>  <dbl>
#> 1     0   0     0.333
#> 2     1   0.25  0.699
#> 3     2   0.5   0.900
#> 4     3   0.75  0.974
#> 5     4   1     0.995