mcmc.PlotTrackingCum | R Documentation |
Plots the actual and expected cumulative total repeat transactions by all customers for the calibration and holdout periods, and returns this comparison in a matrix.
mcmc.PlotTrackingCum(
draws,
T.cal,
T.tot,
actual.cu.tracking.data,
xlab = "Week",
ylab = "Cumulative Transactions",
xticklab = NULL,
title = "Tracking Cumulative Transactions",
ymax = NULL,
sample_size = 10000,
covariates = NULL,
legend = c("Actual", "Model")
)
draws |
MCMC draws as returned by |
T.cal |
A vector to represent customers' calibration period lengths (in
other words, the |
T.tot |
End of holdout period. Must be a single value, not a vector. |
actual.cu.tracking.data |
A vector containing the cumulative 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 |
covariates |
(optional) Matrix of covariates, for Pareto/NBD (Abe)
model, passed to |
legend |
plot legend, defaults to 'Actual' and 'Model'. |
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.
Matrix containing actual and expected cumulative repeat transactions.
mcmc.PlotTrackingInc
mcmc.ExpectedCumulativeTransactions
elog2cum
## Not run:
data("groceryElog")
cbs <- elog2cbs(groceryElog, T.cal = "2006-12-31")
cum <- elog2cum(groceryElog)
param.draws <- pnbd.mcmc.DrawParameters(cbs)
mat <- mcmc.PlotTrackingCum(param.draws,
T.cal = cbs$T.cal,
T.tot = max(cbs$T.cal + cbs$T.star),
actual.cu.tracking.data = cum)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.