bgnbd.PlotTrackingInc {BTYD}R Documentation

BG/NBD Tracking Incremental Transactions Comparison


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.


  T.tot,, = NA,
  hardie = TRUE,
  xlab = "Week",
  ylab = "Transactions",
  xticklab = NULL,
  title = "Tracking Weekly Transactions"



BG/NBD parameters - a vector with r, alpha, a, and b, in that order. r and alpha are unobserved parameters for the NBD transaction process. a and b are unobserved parameters for the Beta geometric dropout process.

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


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

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

number of time periods in the calibration and holdout periods. See details.


if TRUE, use h2f1 instead of hypergeo.


descriptive label for the x axis.


descriptive label for the y axis.


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


title placed on the top-center of the plot.

Details does not have to be in the same unit of time as the data. T.tot will automatically be divided into periods to match the length of See bgnbd.ExpectedCumulativeTransactions.

The holdout period should immediately follow the calibration period. This function assume that all customers' calibration periods end on the same date, rather than starting on the same date (thus customers' birth periods are determined using max( - rather than assuming that it is 0).


Matrix containing actual and expected incremental repeat transactions.


data(cdnowSummary) <- cdnowSummary$cbs
# already has column names required by method

# Cumulative repeat transactions made by all customers across calibration
# and holdout periods
cu.tracking <- cdnowSummary$cu.tracking
# make the tracking data incremental
inc.tracking <- dc.CumulativeToIncremental(cu.tracking)

# parameters estimated using bgnbd.EstimateParameters
est.params <- c(0.243, 4.414, 0.793, 2.426)

# All parameters are in weeks; the calibration period lasted 39
# weeks and the holdout period another 39.
bgnbd.PlotTrackingInc(est.params, ,
                      T.tot = 78,
             = inc.tracking, 
                      hardie = TRUE)

[Package BTYD version 2.4.3 Index]