mcmc.PlotTrackingInc {BTYDplus}R Documentation

Tracking Incremental Transactions Plot for Pareto/GGG, Pareto/NBD (HB) and Pareto/NBD (Abe)

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

mcmc.PlotTrackingInc(
  draws,
  T.cal,
  T.tot,
  actual.inc.tracking.data,
  xlab = "Week",
  ylab = "Transactions",
  xticklab = NULL,
  title = "Tracking Weekly Transactions",
  ymax = NULL,
  sample_size = 10000,
  covariates = NULL,
  legend = c("Actual", "Model")
)

Arguments

draws

MCMC draws as returned by *.mcmc.DrawParameters

T.cal

A vector to represent customers' calibration period lengths (in other words, the T.cal column from a customer-by-sufficient-statistic matrix). Considering rounding in order to speed up calculations.

T.tot

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

actual.inc.tracking.data

A 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

A 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.

sample_size

Sample size for estimating the probability distribution. See mcmc.ExpectedCumulativeTransactions.

covariates

(optional) Matrix of covariates, for Pareto/NBD (Abe) model, passed to abe.GenerateData for simulating data.

legend

plot legend, defaults to 'Actual' and 'Model'.

Details

The expected transactions need to be sampled. Due to this sampling, the return result varies from one call to another. Larger values of sample_size will generate more stable results.

Value

Matrix containing actual and expected incremental repeat transactions.

See Also

mcmc.PlotTrackingCum mcmc.ExpectedCumulativeTransactions elog2inc

Examples

## Not run: 
data("groceryElog")
cbs <- elog2cbs(groceryElog, T.cal = "2006-12-31")
inc <- elog2inc(groceryElog)
param.draws <- pnbd.mcmc.DrawParameters(cbs)
mat <- mcmc.PlotTrackingInc(param.draws,
  T.cal = cbs$T.cal,
  T.tot = max(cbs$T.cal + cbs$T.star),
  actual.inc.tracking.data = inc)

## End(Not run)

[Package BTYDplus version 1.2.0 Index]