View source: R/sample_page_views_per_session.R
sample_page_views_per_session | R Documentation |
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 (k
and \theta
parameters)
'samples' in each row should be a tibble of length 'n_samples'
sample_page_views_per_session(input_df, priors, n_samples = 50000)
input_df |
Dataframe containing option_name (str), sum_sessions (dbl), and sum_page_views_per_session (dbl). |
priors |
Optional list of priors k0 and theta0.
Default |
n_samples |
Optional integer value. Defaults to 50,000 samples. |
See update_rules vignette for a mathematical representation.
page_views_i ~ Poisson(\lambda)
\lambda ~ Gamma(k, \theta)
Page Views Per Visit is sampled from a Gamma distribution with a Poisson likelihood of an individual having n page views by the end of their session.
This is not always the case, so verify your data follows the shape of an Poisson distribution before using this.
input_df with 2 new nested columns 'gamma_params' and 'samples'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.