mbgcnbd.PlotFreqVsConditionalExpectedFrequency {BTYDplus} | R Documentation |
(M)BG/CNBD-k Plot Frequency vs. Conditional Expected Frequency
Description
Plots the actual and conditional expected number transactions made by customers in the holdout period, binned according to calibration period frequencies, and returns this comparison in a matrix.
Usage
mbgcnbd.PlotFreqVsConditionalExpectedFrequency(
params,
T.star,
cal.cbs,
x.star,
censor,
xlab = "Calibration period transactions",
ylab = "Holdout period transactions",
xticklab = NULL,
title = "Conditional Expectation"
)
bgcnbd.PlotFreqVsConditionalExpectedFrequency(
params,
T.star,
cal.cbs,
x.star,
censor,
xlab = "Calibration period transactions",
ylab = "Holdout period transactions",
xticklab = NULL,
title = "Conditional Expectation"
)
Arguments
params |
A vector with model parameters |
T.star |
Length of the holdout period. |
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'). |
x.star |
Vector of transactions made by each customer in the holdout period. |
censor |
Cutoff point for number of transactions in plot. |
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
Holdout period transaction frequency comparison matrix (actual vs. expected).
See Also
bgcnbd.PlotFreqVsConditionalExpectedFrequency
Examples
## Not run:
data("groceryElog")
cbs <- elog2cbs(groceryElog, T.cal = "2006-09-30")
params <- mbgcnbd.EstimateParameters(cbs, k=2)
mbgcnbd.PlotFreqVsConditionalExpectedFrequency(params, T.star=52, cbs, cbs$x.star, censor=7)
## End(Not run)