sample_response_rate: Sample Response Rate

View source: R/sample_response_rate.R

sample_response_rateR Documentation

Sample Response Rate

Description

This is an alias for sample_conv_rate with a different input column. Adds 2 new nested columns to the input_df: 'beta_params' and 'samples' 'beta_params' in each row should be a tibble of length 2 (\alpha and \beta parameters) 'samples' in each row should be a tibble of length 'n_samples'

Usage

sample_response_rate(input_df, priors, n_samples = 50000)

Arguments

input_df

Dataframe containing option_name (str), sum_conversions (dbl), and sum_sessions (dbl).

priors

Optional list of priors alpha0 and beta0. Default Beta(1,1) will be use otherwise.

n_samples

Optional integer value. Defaults to 50,000 samples.

Details

See update_rules vignette for a mathematical representation.

conversion_i ~ Bernoulli(\phi)

\phi ~ Beta(\alpha, \beta)

Response Rate is sampled from a Beta distribution with a Binomial likelihood of an individual converting.

Value

input_df with 2 new nested columns 'beta_params' and 'samples'


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