sample_cpc {grizbayr}R Documentation

Sample Cost Per Click

Description

Adds 2 new nested columns to the input_df: 'gamma_params' and 'samples' 'gamma_params' in each row should be a tibble of length 2 (kk and θ\theta parameters) 'samples' in each row should be a tibble of length 'n_samples'

Usage

sample_cpc(input_df, priors, n_samples = 50000)

Arguments

input_df

Dataframe containing option_name (str), sum_clicks (dbl), sum_cost (dbl).

priors

Optional list of priors k0, theta0 for Gamma. Default Gamma(1,250)Gamma(1, 250) will be use otherwise.

n_samples

Optional integer value. Defaults to 50,000 samples.

Details

See update_rules vignette for a mathematical representation.

cpci Exponential(λ)cpc_i ~ Exponential(\lambda)

λ Gamma(k,θ)\lambda ~ Gamma(k, \theta)

Average CPC is sampled from a Gamma distribution with an Exponential likelihood of an individual cost.

Value

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


[Package grizbayr version 1.3.5 Index]