bgnbd.ConditionalExpectedTransactions: BG/NBD Conditional Expected Transactions

Description Usage Arguments Details Value References See Also Examples

View source: R/bgnbd.R

Description

E[X(T.cal, T.cal + T.star) | x, t.x, r, alpha, a, b]

Usage

1
2
3
4
5
6
7
8
bgnbd.ConditionalExpectedTransactions(
  params,
  T.star,
  x,
  t.x,
  T.cal,
  hardie = TRUE
)

Arguments

params

BG/NBD parameters - a vector with r, alpha, a, and b, in that order. r and alpha are unobserved parameters for the NBD transaction process. a and b are unobserved parameters for the Beta geometric dropout process.

T.star

length of time for which we are calculating the expected number of transactions.

x

number of repeat transactions in the calibration period T.cal, or a vector of transaction frequencies.

t.x

time of most recent repeat transaction, or a vector of recencies.

T.cal

length of calibration period, or a vector of calibration period lengths.

hardie

if TRUE, use h2f1 instead of hypergeo.

Details

T.star, x, t.x and T.cal may be vectors. The standard rules for vector operations apply - if they are not of the same length, shorter vectors will be recycled (start over at the first element) until they are as long as the longest vector. It is advisable to keep vectors to the same length and to use single values for parameters that are to be the same for all calculations. If one of these parameters has a length greater than one, the output will be a vector of probabilities.

Value

Number of transactions a customer is expected to make in a time period of length t, conditional on their past behavior. If any of the input parameters has a length greater than 1, this will be a vector of expected number of transactions.

References

Fader, Peter S.; Hardie, Bruce G.S.and Lee, Ka Lok. “Computing P(alive) Using the BG/NBD Model.” December. 2008. Web. http://www.brucehardie.com/notes/021/palive_for_BGNBD.pdf

See Also

bgnbd.Expectation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
params <- c(0.243, 4.414, 0.793, 2.426)
# Number of transactions a customer is expected to make in 2 time
# intervals, given that they made 10 repeat transactions in a time period
# of 39 intervals, with the 10th repeat transaction occurring in the 35th
# interval.
bgnbd.ConditionalExpectedTransactions(params, T.star=2, x=10, t.x=35, T.cal=39)

# We can also compare expected transactions across different
# calibration period behaviors:
bgnbd.ConditionalExpectedTransactions(params, T.star=2, x=5:20, t.x=25, T.cal=39)

Example output

Loading required package: hypergeo
[1] 0.3915692
 [1] 0.122171799 0.128104150 0.127536556 0.121369942 0.110984904 0.097978545
 [7] 0.083880081 0.069937192 0.057017603 0.045615565 0.035922504 0.027919325
[13] 0.021461762 0.016345967 0.012352516 0.009272427

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