Learn R Programming

grizbayr (version 1.3.5)

estimate_win_prob_given_posterior: Estimate Win Probability Given Posterior Distribution

Description

Estimate Win Probability Given Posterior Distribution

Usage

estimate_win_prob_given_posterior(posterior_samples, winner_is_max = TRUE)

Value

Tibble of each option_name and the win probability expressed as a percentage and a decimal `raw`

Arguments

posterior_samples

Tibble of data in long form with 2 columns `option_name` and `samples`

winner_is_max

Boolean. This should almost always be TRUE. If a larger number is better then this should be TRUE. This should be FALSE for metrics such as CPA or CPC where a higher cost is not necessarily better.

Examples

Run this code
# Requires posterior_samples dataframe. See `sample_from_posterior()`
# for an example.
if (FALSE) {
estimate_win_prob_given_posterior(posterior_samples = posterior_samples)
estimate_win_prob_given_posterior(
    posterior_samples = posterior_samples,
    winner_is_max = TRUE
)
}

Run the code above in your browser using DataLab