Learn R Programming

BTYDplus (version 0.7.2)

mbgcnbd.GenerateData: 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, return.elog = FALSE)

bgcnbd.GenerateData(n, T.cal, T.star = NULL, params, return.elog = FALSE)

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.

return.elog

If TRUE then the event log is returned in addition to the CBS summary.

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 and t.

References

Platzer Michael, and Thomas Reutterer (forthcoming)

See Also

bgcnbd.GenerateData

Examples

Run this code
# NOT RUN {
params <- c(k = 3, r = 0.85, alpha = 1.45, a = 0.79, b = 2.42)
data <- mbgcnbd.GenerateData(n = 4000, T.cal = 24, T.star = 32, params, return.elog = TRUE)

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

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

Run the code above in your browser using DataLab