# NOT RUN {
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))
# }
Run the code above in your browser using DataLab