CLVTools-package {CLVTools}R Documentation

Customer Lifetime Value Tools


CLVTools is a toolbox for various probabilistic customer attrition models for non-contractual settings. It provides a framework, which is capable of unifying different probabilistic customer attrition models. This package provides tools to estimate the number of future transactions of individual customers as well as the probability of customers being alive in future periods. Further, the average spending by customers can be estimated. Multiplying the future transactions conditional on being alive and the predicted individual spending per transaction results in an individual CLV value.

The implemented models require transactional data from non-contractual businesses (i.e. customers' purchase history).


Maintainer: Patrick Bachmann


See Also

Development for CLVTools can be followed via the GitHub repository at



# Create a CLV data object, split data in estimation and holdout sample <- clvdata(data.transactions = cdnow, date.format = "ymd",
                          time.unit = "week", estimation.split = 39, = "Id")

# summary of data

# Fit a PNBD model without covariates on the first 39 periods
pnbd.cdnow <- pnbd(,
                   start.params.model = c(r=0.5, alpha=8, s=0.5, beta=10))
# inspect fit

# Predict 10 periods (weeks) ahead from estimation end
#   and compare to actuals in this period
pred.out <- predict(pnbd.cdnow, prediction.end = 10)

# Plot the fitted model to the actual repeat transactions

[Package CLVTools version 0.9.0 Index]