Package: CLVTools 0.11.1

Patrick Bachmann

CLVTools: Tools for Customer Lifetime Value Estimation

A set of state-of-the-art probabilistic modeling approaches to derive estimates of individual customer lifetime values (CLV). Commonly, probabilistic approaches focus on modelling 3 processes, i.e. individuals' attrition, transaction, and spending process. Latent customer attrition models, which are also known as "buy-'til-you-die models", model the attrition as well as the transaction process. They are used to make inferences and predictions about transactional patterns of individual customers such as their future purchase behavior. Moreover, these models have also been used to predict individuals’ long-term engagement in activities such as playing an online game or posting to a social media platform. The spending process is usually modelled by a separate probabilistic model. Combining these results yields in lifetime values estimates for individual customers. This package includes fast and accurate implementations of various probabilistic models for non-contractual settings (e.g., grocery purchases or hotel visits). All implementations support time-invariant covariates, which can be used to control for e.g., socio-demographics. If such an extension has been proposed in literature, we further provide the possibility to control for time-varying covariates to control for e.g., seasonal patterns. Currently, the package includes the following latent attrition models to model individuals' attrition and transaction process: [1] Pareto/NBD model (Pareto/Negative-Binomial-Distribution), [2] the Extended Pareto/NBD model (Pareto/Negative-Binomial-Distribution with time-varying covariates), [3] the BG/NBD model (Beta-Gamma/Negative-Binomial-Distribution) and the [4] GGom/NBD (Gamma-Gompertz/Negative-Binomial-Distribution). Further, we provide an implementation of the Gamma/Gamma model to model the spending process of individuals.

Authors:Patrick Bachmann [cre, aut], Niels Kuebler [aut], Markus Meierer [aut], Jeffrey Naef [aut], E. Shin Oblander [aut], Patrik Schilter [aut]

CLVTools_0.11.1.tar.gz
CLVTools_0.11.1.tar.gz(r-4.5-noble)CLVTools_0.11.1.tar.gz(r-4.4-noble)
CLVTools_0.11.1.tgz(r-4.4-emscripten)CLVTools_0.11.1.tgz(r-4.3-emscripten)
CLVTools.pdf |CLVTools.html
CLVTools/json (API)
NEWS

# Install 'CLVTools' in R:
install.packages('CLVTools', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/bachmannpatrick/clvtools/issues

Uses libs:
  • openblas– Optimized BLAS
  • gsl– GNU Scientific Library (GSL)
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:

2.40 score 12 scripts 1.1k downloads 20 exports 58 dependencies

Last updated 1 months agofrom:73db5d959c. Checks:OK: 1 WARNING: 1. Indexed: no.

TargetResultDate
Doc / VignettesOKNov 13 2024
R-4.5-linux-x86_64WARNINGNov 13 2024

Exports:as.clv.databgbbbgnbdclv.bootstrapped.applyclvdataggggomnbdlatentAttritionlrtestnewcustomernewcustomer.dynamicnewcustomer.staticplotpmfpnbdpredictSetDynamicCovariatesSetStaticCovariatesshowspending

Dependencies:briocallrclicolorspacecpp11crayondata.tabledescdiffobjdigestevaluatefansifarverFormulafsgenericsggplot2gluegtableisobandjsonlitelabelinglatticelifecyclelubridatemagrittrMASSMatrixmgcvmunsellnlmenloptrnumDerivoptimxpillarpkgbuildpkgconfigpkgloadpracmapraiseprocessxpsR6RColorBrewerRcppRcppArmadilloRcppGSLrlangrprojrootscalestestthattibbletimechangeutf8vctrsviridisLitewaldowithr

Walkthrough for the CLVTools Package

Rendered fromCLVTools.Rmdusingknitr::rmarkdownon Nov 13 2024.

Last update: 2024-10-13
Started: 2020-05-08

Readme and manuals

Help Manual

Help pageTopics
Customer Lifetime Value ToolsCLVTools-package CLVTools
Time-varying Covariates for the Apparel Retailer DatasetapparelDynCov
Future Time-varying Covariates for the Apparel Retailer DatasetapparelDynCovFuture
Time-invariant Covariates for the Apparel Retailer DatasetapparelStaticCov
Apparel Retailer DatasetapparelTrans
Coerce to clv.data objectas.clv.data as.clv.data.data.frame as.clv.data.data.table
Coerce to a Data Frameas.data.frame.clv.data
Coerce to a Data Tableas.data.table.clv.data
BG/BB models - Work In Progressbgbb bgbb,clv.data-method bgbb,clv.data.dynamic.covariates-method bgbb,clv.data.static.covariates-method
BG/NBD modelsbgnbd bgnbd,clv.data-method bgnbd,clv.data.dynamic.covariates-method bgnbd,clv.data.static.covariates-method
BG/NBD: Conditional Expected Transactionsbgnbd_CET bgnbd_nocov_CET bgnbd_staticcov_CET
BG/NBD: Unconditional Expectationbgnbd_expectation bgnbd_nocov_expectation bgnbd_staticcov_expectation
BG/NBD: Log-Likelihood functionsbgnbd_LL bgnbd_nocov_LL_ind bgnbd_nocov_LL_sum bgnbd_staticcov_LL_ind bgnbd_staticcov_LL_sum
BG/NBD: Probability of Being Alivebgnbd_nocov_PAlive bgnbd_PAlive bgnbd_staticcov_PAlive
BG/NBD: Probability Mass Function (PMF)bgnbd_nocov_PMF bgnbd_pmf bgnbd_staticcov_PMF
CDNOW datasetcdnow
Bootstrapping: Fit a model again on sampled data and apply methodclv.bootstrapped.apply
Create an object for transactional data required to estimate CLVclvdata
Extract Unconditional Expectationfitted.clv.fitted
Gamma/Gamma Spending modelgg gg,clv.data-method
Gamma-Gamma: Log-Likelihood Functiongg_LL
Gamma-Gompertz/NBD modelggomnbd ggomnbd,clv.data-method ggomnbd,clv.data.dynamic.covariates-method ggomnbd,clv.data.static.covariates-method
GGompertz/NBD: Conditional Expected Transactionsggomnbd_CET ggomnbd_nocov_CET ggomnbd_staticcov_CET
GGompertz/NBD: Unconditional Expectationggomnbd_expectation ggomnbd_nocov_expectation ggomnbd_staticcov_expectation
GGompertz/NBD: Log-Likelihood functionsggomnbd_LL ggomnbd_nocov_LL_ind ggomnbd_nocov_LL_sum ggomnbd_staticcov_LL_ind ggomnbd_staticcov_LL_sum
GGompertz/NBD: Probability of Being Aliveggomnbd_nocov_PAlive ggomnbd_PAlive ggomnbd_staticcov_PAlive
GGompertz/NBD: Probability Mass Function (PMF)ggomnbd_nocov_PMF ggomnbd_PMF ggomnbd_staticcov_PMF
Formula Interface for Latent Attrition ModelslatentAttrition
Likelihood Ratio Test of Nested Modelslrtest lrtest,clv.fitted-method lrtest.clv.fitted
New customer prediction datanewcustomer newcustomer.dynamic newcustomer.static
Number of observationsnobs.clv.data
Number of observationsnobs.clv.fitted
Plot Diagnostics for the Transaction data in a clv.data Objectplot.clv.data
Plot expected and actual mean spending per transactionplot,clv.fitted.spending-method plot.clv.fitted.spending
Plot Diagnostics for a Fitted Transaction Modelplot plot,clv.fitted.transactions-method plot.clv.fitted.transactions
Probability Mass Functionpmf pmf,clv.fitted.transactions-method
Pareto/NBD modelspnbd pnbd,clv.data-method pnbd,clv.data.dynamic.covariates-method pnbd,clv.data.static.covariates-method
Pareto/NBD: Conditional Expected Transactionspnbd_CET pnbd_nocov_CET pnbd_staticcov_CET
Pareto/NBD: Discounted Expected Residual Transactionspnbd_DERT pnbd_nocov_DERT pnbd_staticcov_DERT
Pareto/NBD: Unconditional Expectationpnbd_expectation pnbd_nocov_expectation pnbd_staticcov_expectation
Pareto/NBD: Log-Likelihood functionspnbd_LL pnbd_nocov_LL_ind pnbd_nocov_LL_sum pnbd_staticcov_LL_ind pnbd_staticcov_LL_sum
Pareto/NBD: Probability of Being Alivepnbd_nocov_PAlive pnbd_PAlive pnbd_staticcov_PAlive
Pareto/NBD: Probability Mass Function (PMF)pnbd_nocov_PMF pnbd_pmf pnbd_staticcov_PMF
Predict customers' future spendingpredict,clv.fitted.spending-method predict.clv.fitted.spending
Predict CLV from a fitted transaction modelpredict predict,clv.fitted.transactions-method predict.clv.fitted.transactions
Add Dynamic Covariates to a CLV data objectSetDynamicCovariates
Add Static Covariates to a CLV data objectSetStaticCovariates
Formula Interface for Spending Modelsspending
Subsetting clv.datasubset subset.clv.data
Summarizing a fitted CLV modelprint.summary.clv.fitted summary.clv.fitted summary.clv.fitted.transactions.static.cov
Calculate Variance-Covariance Matrix for CLV Models fitted with Maximum Likelihood Estimationvcov.clv.fitted