Learn R Programming

BTYDplus (version 0.7.2)

bgcnbd.GenerateData: Simulate data according to BG/CNBD-k model assumptions

Description

Simulate data according to BG/CNBD-k model assumptions

Usage

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

Arguments

n

number of customers

T.cal

length of calibration period; if vector then it is assumed that customers have different 'birth' dates, i.e. max(T.cal)-T.cal

T.star

length(s) of holdout period(s); assumed to be same for all customers

params

BG/CNBD-k parameters - a vector with k, r, alpha, a and b in that order.

return.elog

boolean - if TRUE then the event log is returned in addition to the CBS summary

dropout_at_zero

Boolean; the mbg-methods are simple wrapper methods, which set this parameter to TRUE

Value

list with elements cbs and elog containing data.frames

References

Platzer Michael, and Thomas Reutterer (forthcoming)

See Also

bgcnbd.EstimateParameters

Examples

Run this code
# NOT RUN {
params <- c(k = 3, r = 0.85, alpha = 1.45, a = 0.79, b = 2.42)
data <- bgcnbd.GenerateData(n = 4000, T.cal = 24, T.star = 32, params, return.elog = TRUE)
cbs <- data$cbs  # customer by sufficient summary statistic - one row per customer
elog <- data$elog  # Event log - one row per event/purchase
# }

Run the code above in your browser using DataLab