bgbb.HeatmapHoldoutExpectedTrans: BG/BB Heatmap of Holdout Period Expected Transactions

Description Usage Arguments Details Value References See Also Examples

View source: R/bgbb.R

Description

Plots a heatmap based on the conditional expected holdout period frequency for each recency-frequency combination in the calibration period.

Usage

1
2
3
4
5
6
7
8
9
bgbb.HeatmapHoldoutExpectedTrans(
  params,
  n.cal,
  n.star,
  xlab = "Recency",
  ylab = "Frequency",
  xticklab = NULL,
  title = "Heatmap of Conditional Expected Transactions"
)

Arguments

params

BG/BB parameters - a vector with alpha, beta, gamma, and delta, in that order. Alpha and beta are unobserved parameters for the beta-Bernoulli transaction process. Gamma and delta are unobserved parameters for the beta-geometric dropout process.

n.cal

number of transaction opportunities in the calibration period.

n.star

number of transaction opportunities in the holdout period.

xlab

descriptive label for the x axis.

ylab

descriptive label for the y axis.

xticklab

vector containing a label for each tick mark on the x axis.

title

title placed on the top-center of the plot.

Details

E(X(n, n+n*) | alpha, beta, gamma, delta, x, t.x, n). This function requires the holdout period to immediately follow the calibration period.

Value

A matrix containing the conditional expected transactions in the holdout period for each recency-frequency combination in the calibration period. The rows represent calibration period frequencies, and the columns represent calibration period recencies.

References

Fader, Peter S., Bruce G.S. Hardie, and Jen Shang. "Customer-Base Analysis in a Discrete-Time Noncontractual Setting." Marketing Science 29(6), pp. 1086-1108. 2010. INFORMS. Web.

See Also

bgbb.ConditionalExpectedTransactions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(donationsSummary)

rf.matrix <- donationsSummary$rf.matrix
# donationsSummary$rf.matrix already has appropriate column names

# starting-point parameters
startingparams <- c(1, 1, 0.5, 3)
# estimated parameters
est.params <- bgbb.EstimateParameters(rf.matrix, startingparams)

# Plot a heatmap of conditional expected transactions in
# a holdout period of 5 transaction opportunities, given
# that the calibration period consisted of 6 transaction
# opportunities.
bgbb.HeatmapHoldoutExpectedTrans(est.params, n.cal=6, n.star=5)

Example output

Loading required package: hypergeo
layout: widths =  0.05 4 , heights =  0.25 4 ; lmat=
     [,1] [,2]
[1,]    0    3
[2,]    2    1
          0          1         2         3         4        5        6
0 0.0728617 0.00000000 0.0000000 0.0000000 0.0000000 0.000000 0.000000
1 0.0000000 0.08569864 0.3142616 0.5939084 0.8394721 1.021772 1.147967
2 0.0000000 0.00000000 0.1191319 0.5361565 1.0576836 1.443129 1.668896
3 0.0000000 0.00000000 0.0000000 0.2236237 1.0346572 1.804798 2.189825
4 0.0000000 0.00000000 0.0000000 0.0000000 0.5832723 2.030136 2.710755
5 0.0000000 0.00000000 0.0000000 0.0000000 0.0000000 1.813105 3.231684
6 0.0000000 0.00000000 0.0000000 0.0000000 0.0000000 0.000000 3.752613

BTYD documentation built on Nov. 18, 2021, 1:10 a.m.