Learn R Programming

BTYDplus (version 0.7.2)

mcmc.PlotFrequencyInCalibration: Frequency in Calibration Period for Pareto/GGG, Pareto/NBD (HB) and Pareto/NBD (Abe)

Description

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.

Usage

mcmc.PlotFrequencyInCalibration(draws, cal.cbs, censor = 7,
  xlab = "Calibration period transactions", ylab = "Customers",
  title = "Frequency of Repeat Transactions", sample_size = 1000)

Arguments

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 mcmc.pmf.

Value

Calibration period repeat transaction frequency comparison matrix (actual vs. expected).

Details

The method mcmc.pmf is called to calculate the expected numbers based on the corresponding model.

See Also

mcmc.pmf

Examples

Run this code
# NOT RUN {
cbs <- cdnow.sample()$cbs
# for demo purposes we use short MCMC runs and small sample size
param.draws <- pnbd.mcmc.DrawParameters(cbs, 
  mcmc = 200, burnin = 100, thin = 20, chains = 1)
mcmc.PlotFrequencyInCalibration(param.draws, cbs, sample_size = 100)
# }

Run the code above in your browser using DataLab