sample_multi_rev_per_session {grizbayr} | R Documentation |
Sample Multiple Revenue Per Session
Description
Adds 5 new nested columns to the input_df: 'dirichlet_params', 'gamma_params_A', 'gamma_params_B', and 'samples'. This samples from multiple revenue per session distributions at once.
Usage
sample_multi_rev_per_session(input_df, priors, n_samples = 50000)
Arguments
input_df |
Dataframe containing option_name (str), sum_conversions (dbl), sum_sessions (dbl), sum_revenue (dbl), sum_conversion_2 (dbl), sum_sessions_2 (dbl), sum_revenue_2 (dbl). |
priors |
Optional list of priors alpha0 and beta0.
Default |
n_samples |
Optional integer value. Defaults to 50,000 samples. |
Details
See update_rules vignette for a mathematical representation.
conversion_i ~ MultiNomial(\phi_1, \phi_2, ..., \phi_k)
\phi_k ~ Dirichlet(\alpha, \beta)
Conversion Rate is sampled from a Dirichlet distribution with a Multinomial likelihood of an individual converting.
Value
input_df with 4 new nested columns 'dirichlet_params', 'gamma_params_A', 'gamma_params_B', and 'samples'. 'samples' in each row should be a tibble of length 'n_samples'.