sample_cm_per_click: Sample CM Per Click

View source: R/sample_cm_per_click.R

sample_cm_per_clickR Documentation

Sample CM Per Click

Description

Adds 4 new nested columns to the input_df: 'beta_params', 'gamma_params_rev', 'gamma_params_cost'and 'samples'

Usage

sample_cm_per_click(input_df, priors, n_samples = 50000)

Arguments

input_df

Dataframe containing option_name (str), sum_conversions (dbl), sum_revenue (dbl), and sum_clicks (dbl).

priors

Optional list of priors alpha0, beta0 for Beta, k0, theta0 for Gamma Inverse Revenue, and k01, theta01 for Gamma Cost (uses alternate priors so they can be different from Revenue). Default Beta(1,1) and Gamma(1, 250) will be use otherwise.

n_samples

Optional integer value. Defaults to 50,000 samples.

Details

'beta_params' and 'gamma_params_rev' in each row should be a tibble of length 2 (\alpha and \beta parameters and k and \theta parameters) 'samples' in each row should be a tibble of length 'n_samples'

See update_rules vignette for a mathematical representation.

CMPerClick = ConversionsPerClick * RevPerConversion - CostPerClick

Value

input_df with 4 new nested columns 'beta_params', 'gamma_params_rev', 'gamma_params_cost', and 'samples'


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