mbgcnbd.GenerateData {BTYDplus}R Documentation

Simulate data according to (M)BG/CNBD-k model assumptions

Description

Simulate data according to (M)BG/CNBD-k model assumptions

Usage

mbgcnbd.GenerateData(n, T.cal, T.star = NULL, params, date.zero = "2000-01-01")

bgcnbd.GenerateData(n, T.cal, T.star = NULL, params, date.zero = "2000-01-01")

Arguments

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. max(T.cal)-T.cal.

T.star

Length of holdout period. This may be a vector.

params

A vector with model parameters k, r, alpha, a and b, in that order.

date.zero

Initial date for cohort start. Can be of class character, Date or POSIXt.

Value

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 cust, date and t.

References

(M)BG/CNBD-k: Reutterer, T., Platzer, M., & Schroeder, N. (2020). Leveraging purchase regularity for predicting customer behavior the easy way. International Journal of Research in Marketing. doi: 10.1016/j.ijresmar.2020.09.002

Examples

params <- c(k = 3, r = 0.85, alpha = 1.45, a = 0.79, b = 2.42)
data <- mbgcnbd.GenerateData(n = 200, T.cal = 24, T.star = 32, params)

# customer by sufficient summary statistic - one row per customer
head(data$cbs)

# event log - one row per event/transaction
head(data$elog)

[Package BTYDplus version 1.2.0 Index]