pnbd.PAlive: Pareto/NBD P(Alive)

Description Usage Arguments Details Value References Examples

View source: R/pnbd.R

Description

Uses Pareto/NBD model parameters and a customer's past transaction behavior to return the probability that they are still alive at the end of the calibration period.

Usage

1
pnbd.PAlive(params, x, t.x, T.cal, hardie = TRUE)

Arguments

params

Pareto/NBD parameters - a vector with r, alpha, s, and beta, in that order. r and alpha are unobserved parameters for the NBD transaction process. s and beta are unobserved parameters for the Pareto (exponential gamma) dropout process.

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

P(Alive | X=x, t.x, T.cal, r, alpha, s, beta)

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

Probability that the customer is still alive at the end of the calibration period. If x, t.x, and/or T.cal has a length greater than one, then this will be a vector of probabilities (containing one element matching each element of the longest input vector).

References

Fader, Peter S., and Bruce G.S. Hardie. "A Note on Deriving the Pareto/NBD Model and Related Expressions." November. 2005. Web. http://www.brucehardie.com/notes/008/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(cdnowSummary)
cbs <- cdnowSummary$cbs
params <- pnbd.EstimateParameters(cbs, hardie = TRUE)

pnbd.PAlive(params, x=0, t.x=0, T.cal=39, TRUE)
# 0.2941633; P(Alive) of a customer who made no repeat transactions.

pnbd.PAlive(params, x=23, t.x=39, T.cal=39, TRUE)
# 1; P(Alive) of a customer who has the same recency and total
# time observed.

pnbd.PAlive(params, x=5:20, t.x=30, T.cal=39, TRUE)
# Note the "increasing frequency paradox".

# To visualize the distribution of P(Alive) across customers:
p.alives <- pnbd.PAlive(params, cbs[,"x"], cbs[,"t.x"], cbs[,"T.cal"], TRUE)
plot(density(p.alives))

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