Learn R Programming

BTYDplus (version 0.7.2)

bgcnbd.PlotFrequencyInCalibration: BG/CNBD-k Plot Frequency in Calibration Period

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

bgcnbd.PlotFrequencyInCalibration(params, cal.cbs, censor = NULL,
  plotZero = TRUE, xlab = "Calibration period transactions",
  ylab = "Customers", title = "Frequency of Repeat Transactions",
  dropout_at_zero = FALSE)

Arguments

params

BG/CNBD-k parameters - a vector with 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

integer used to censor the data.

plotZero

If FALSE, the histogram will exclude the zero bin.

xlab

descriptive label for the x axis.

ylab

descriptive label for the y axis.

title

title placed on the top-center of the plot.

dropout_at_zero

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

Value

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

References

Platzer Michael, and Thomas Reutterer (forthcoming)

See Also

bgnbd.PlotFrequencyInCalibration

Examples

Run this code
# NOT RUN {
params <- c(k=3, r=0.85, alpha=1.45, a=0.79, b=2.42)
cbs <- bgcnbd.GenerateData(n=5000, 32, 0, params)$cbs
bgcnbd.PlotFrequencyInCalibration(params, cbs, censor = 7)
# }

Run the code above in your browser using DataLab