mcmc.PlotFrequencyInCalibration | R Documentation |
Plots a histogram and returns a matrix comparing the actual and expected number of customers who made a certain number of repeat transactions in the calibration period, binned according to calibration period frequencies.
mcmc.PlotFrequencyInCalibration(
draws,
cal.cbs,
censor = 7,
xlab = "Calibration period transactions",
ylab = "Customers",
title = "Frequency of Repeat Transactions",
sample_size = 1000
)
draws |
MCMC draws as returned by |
cal.cbs |
Calibration period customer-by-sufficient-statistic (CBS) data.frame. It must contain columns for frequency ('x') and total time observed ('T.cal'). |
censor |
Cutoff point for number of transactions in plot. |
xlab |
Descriptive label for the x axis. |
ylab |
Descriptive label for the y axis. |
title |
Title placed on the top-center of the plot. |
sample_size |
Sample size for estimating the probability distribution.
See |
The method mcmc.pmf
is called to calculate the expected numbers
based on the corresponding model.
Calibration period repeat transaction frequency comparison matrix (actual vs. expected).
mcmc.pmf
## Not run:
data("groceryElog")
cbs <- elog2cbs(groceryElog, T.cal = "2006-12-31")
param.draws <- pnbd.mcmc.DrawParameters(cbs,
mcmc = 100, burnin = 50, thin = 10, chains = 1) # short MCMC to run demo fast
mcmc.PlotFrequencyInCalibration(param.draws, cbs, sample_size = 100)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.