estimate_all_values: Estimate All Values

View source: R/estimate_all_values.R

estimate_all_valuesR Documentation

Estimate All Values

Description

Efficiently estimates all values at once so the posterior only need to be sampled one time. This function will return as a list win probability, value remaining, estimated percent lift with respect to the provided option, and the win probability of the best option vs the provided option.

Usage

estimate_all_values(
  input_df,
  distribution,
  wrt_option_lift,
  priors = list(),
  wrt_option_vr = NULL,
  loss_threshold = 0.95,
  lift_threshold = 0.7,
  metric = "lift"
)

Arguments

input_df

Dataframe containing option_name (str) and various other columns depending on the distribution type. See vignette for more details.

distribution

String of the distribution name

wrt_option_lift

String: the option lift and win probability is calculated with respect to (wrt). Required.

priors

Optional list of priors. Defaults will be use otherwise.

wrt_option_vr

String: the option against which loss (value remaining) is calculated. If NULL the best option will be used. (optional)

loss_threshold

The confidence interval specifying what the "worst case scenario" should be. Defaults to 95%. (optional)

lift_threshold

The confidence interval specifying how likely the lift is to be true. Defaults to 70%. (optional)

metric

string the type of loss. absolute will be the difference, on the outcome scale. 0 when best = wrt_option lift will be the (best - wrt_option) / wrt_option, 0 when best = wrt_option relative_risk will be the ratio best/wrt_option, 1 when best = wrt_option

Details

TODO: Add high density credible intervals to this output for each option.

Value

A list with 4 named items: Win Probability, Value Remaining, Lift vs Baseline, and Win Probability vs Baseline.

Examples

## Not run: 
input_df <- data.frame(option_name = c("A", "B", "C"),
    sum_clicks = c(1000, 1000, 1000),
    sum_conversions = c(100, 120, 110), stringsAsFactors = FALSE)
estimate_all_values(input_df, distribution = "conversion_rate", wrt_option_lift = "A")

## End(Not run)


grizbayr documentation built on Oct. 9, 2023, 5:10 p.m.