Learn R Programming

BTYDplus (version 0.7.2)

bgcnbd.PlotTrackingInc: BG/CNBD-k Tracking Incremental Transactions Comparison

Description

Plots the actual and expected incremental total repeat transactions by all customers for the calibration and holdout periods, and returns this comparison in a matrix.

Usage

bgcnbd.PlotTrackingInc(params, T.cal, T.tot, actual.inc.tracking.data,
  xlab = "Week", ylab = "Transactions", xticklab = NULL,
  title = "Tracking Weekly Transactions", ymax = NULL,
  dropout_at_zero = FALSE)

Arguments

params

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

T.cal

a vector to represent customers' calibration period lengths (in other words, the 'T.cal' column from a customer-by-sufficient-statistic matrix).

T.tot

end of holdout period. Must be a single value, not a vector.

actual.inc.tracking.data

vector containing the incremental number of repeat transactions made by customers for each period in the total time period (both calibration and holdout periods).

xlab

descriptive label for the x axis.

ylab

descriptive label for the y axis.

xticklab

vector containing a label for each tick mark on the x axis.

title

title placed on the top-center of the plot.

ymax

upper boundary for y axis.

dropout_at_zero

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

Value

Matrix containing actual and expected incremental repeat transactions.

See Also

bgnbd.PlotTrackingInc bgcnbd.PlotTrackingCum

Examples

Run this code
# NOT RUN {
cdnow <- cdnow.sample()
cbs <- cdnow$cbs
inc <- elog2inc(cdnow$elog)
params <- c(k=1, r=0.24, alpha=4.41, a=0.79, b=2.43) # params <- bgcnbd.EstimateParameters(cbs)
bgcnbd.PlotTrackingInc(params, cbs$T.cal, T.tot = 78, inc)
# }

Run the code above in your browser using DataLab