Description Usage Arguments Value Examples
Simulate data according to NBD model assumptions
1 | nbd.GenerateData(n, T.cal, T.star, params, date.zero = "2000-01-01")
|
n |
Number of customers. |
T.cal |
Length of calibration period. |
T.star |
Length of holdout period. This may be a vector. |
params |
NBD parameters - a vector with |
date.zero |
Initial date for cohort start. Can be of class character, Date or POSIXt. |
List of length 2:
|
A data.frame with a row for each customer and the summary statistic as columns. |
|
A data.frame with a row for each transaction, and columns |
1 2 3 4 5 6 7 | n <- 200 # no. of customers
T.cal <- 32 # length of calibration period
T.star <- 32 # length of hold-out period
params <- c(r = 0.85, alpha = 4.45) # purchase frequency lambda_i ~ Gamma(r, alpha)
data <- nbd.GenerateData(n, T.cal, T.star, 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.