Skip to contents

Access a distribution's odds function. The odds of an event having probability p is p / (1 - p).

Usage

eval_odds(distribution, at)

enframe_odds(..., at, arg_name = ".arg", fn_prefix = "odds", 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 odds in vector form (for eval_) and data frame or tibble form (for enframe_).

See also

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

Examples

d <- dst_pois(1)
eval_odds(d, at = c(1, 2, 2.5))
#> [1] 0.5819767 0.2253997 0.0000000
enframe_odds(d, at = 0:4)
#> # A tibble: 5 × 2
#>    .arg   odds
#>   <int>  <dbl>
#> 1     0 0.582 
#> 2     1 0.582 
#> 3     2 0.225 
#> 4     3 0.0653
#> 5     4 0.0156