mbgcnbd.PlotRecVsConditionalExpectedFrequency {BTYDplus} | R Documentation |
(M)BG/CNBD-k Plot Actual vs. Conditional Expected Frequency by Recency
Description
Plots the actual and conditional expected number transactions made by customers in the holdout period, binned according to calibration period recencies, and returns this comparison in a matrix.
Usage
mbgcnbd.PlotRecVsConditionalExpectedFrequency(
params,
cal.cbs,
T.star,
x.star,
xlab = "Calibration period recency",
ylab = "Holdout period transactions",
xticklab = NULL,
title = "Actual vs. Conditional Expected Transactions by Recency"
)
bgcnbd.PlotRecVsConditionalExpectedFrequency(
params,
cal.cbs,
T.star,
x.star,
xlab = "Calibration period recency",
ylab = "Holdout period transactions",
xticklab = NULL,
title = "Actual vs. Conditional Expected Transactions by Recency"
)
Arguments
params |
A vector with model parameters |
cal.cbs |
Calibration period CBS (customer by sufficient statistic). It must contain columns for frequency ('x'), recency ('t.x') and total time observed ('T.cal'). |
T.star |
Length of the holdout period. |
x.star |
Vector of transactions made by each customer in the holdout period. |
xlab |
Descriptive label for the x axis. |
ylab |
Descriptive label for the x 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. |
Value
Matrix comparing actual and conditional expected transactions in the holdout period.
See Also
bgcnbd.PlotFreqVsConditionalExpectedFrequency
Examples
## Not run:
data("groceryElog")
cbs <- elog2cbs(groceryElog, T.cal = "2006-09-30")
params <- mbgcnbd.EstimateParameters(cbs, k=2)
mbgcnbd.PlotRecVsConditionalExpectedFrequency(params, cbs, T.star=52, cbs$x.star)
## End(Not run)