View source: R/pareto-nbd-mcmc.R
pnbd.GenerateData | R Documentation |
Simulate data according to Pareto/NBD model assumptions
pnbd.GenerateData(n, T.cal, T.star, params, date.zero = "2000-01-01")
n |
Number of customers. |
T.cal |
Length of calibration period. If a vector is provided, then it
is assumed that customers have different 'birth' dates, i.e.
|
T.star |
Length of holdout period. This may be a vector. |
params |
A list of model parameters |
date.zero |
Initial date for cohort start. Can be of class character, Date or POSIXt. |
List of length 2:
cbs |
A data.frame with a row for each customer and the summary statistic as columns. |
elog |
A data.frame with a row for each transaction, and columns |
params <- list(r = 5, alpha = 10, s = 0.8, beta = 12)
data <- pnbd.GenerateData(n = 200, T.cal = 32, T.star = 32, params)
cbs <- data$cbs # customer by sufficient summary statistic - one row per customer
elog <- data$elog # Event log - one row per event/purchase
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.