mbgcnbd.PlotFrequencyInCalibration: (M)BG/CNBD-k Plot Frequency in Calibration Period

Description Usage Arguments Value References Examples

View source: R/mbg-cnbd-k.R

Description

Plots a histogram and returns a matrix comparing the actual and expected number of customers who made a certain number of repeat transactions in the calibration period, binned according to calibration period frequencies.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
mbgcnbd.PlotFrequencyInCalibration(
  params,
  cal.cbs,
  censor = 7,
  xlab = "Calibration period transactions",
  ylab = "Customers",
  title = "Frequency of Repeat Transactions"
)

bgcnbd.PlotFrequencyInCalibration(
  params,
  cal.cbs,
  censor = 7,
  xlab = "Calibration period transactions",
  ylab = "Customers",
  title = "Frequency of Repeat Transactions"
)

Arguments

params

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

cal.cbs

Calibration period CBS (customer by sufficient statistic). It must contain columns for frequency ('x') and total time observed ('T.cal').

censor

Cutoff point for number of transactions in plot.

xlab

Descriptive label for the x axis.

ylab

Descriptive label for the y axis.

title

Title placed on the top-center of the plot.

Value

Calibration period repeat transaction frequency comparison matrix (actual vs. expected).

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

1
2
3
4
5
6
7
## Not run: 
data("groceryElog")
cbs <- elog2cbs(groceryElog)
params <- mbgcnbd.EstimateParameters(cbs)
mbgcnbd.PlotFrequencyInCalibration(params, cbs)

## End(Not run)

Example output

               freq.0   freq.1   freq.2   freq.3   freq.4   freq.5   freq.6
n.x.actual   555.0000 191.0000 112.0000 73.00000 65.00000 65.00000 45.00000
n.x.expected 541.6509 215.4598 127.8301 88.91036 67.30196 53.64965 44.26184
              freq.7+
n.x.actual   419.0000
n.x.expected 385.9354

BTYDplus documentation built on Jan. 21, 2021, 5:10 p.m.