Learn R Programming

⚠️There's a newer version (1.2.0) of this package.Take me there.

BTYDplus

Extension to R package BTYD.

Installation

devtools::install_github("mplatzer/BTYDplus", dependencies=TRUE)
library(BTYDplus)
demo(package="BTYDplus")
demo("cdnow")

BTYD Models

These R source files extend the functionality of the BTYD package by providing functions for parameter estimation and scoring for NBD, G/G/NBD, BG/NBD, CBG/NBD and CBG/CNBD-k models.

  • NBD (MLE) - EHRENBERG, ASC. "The Pattern of Consumer Purchases." Quantitative techniques in marketing analysis: text and readings (1962): 355.

  • Gamma/Gompertz/NBD (MLE) - Bemmaor, Albert C., and Nicolas Glady. "Modeling Purchasing Behavior with Sudden Death: A Flexible Customer Lifetime Model." Management Science 58.5 (2012): 1012-1021.

  • CBG/NBD (MLE) - Hoppe, Daniel, and Udo Wagner. "Customer base analysis: The case for a central variant of the Betageometric/NBD Model." Marketing Journal of Research and Management 3.2 (2007): 75-90.

  • CBG/CNBD-k (MLE) - Platzer, Michael. "Stochastic models of noncontractual consumer relationships." Master of Science in Business Administration thesis, Vienna University of Economics and Business Administration, Austria (2008). https://sites.google.com/site/michaelplatzer/stochastic-models-of-noncontractual-consumer-relationships

  • Pareto/NBD (HB) - Ma, Shao-Hui, and Jin-Lan Liu. "The MCMC approach for solving the Pareto/NBD model and possible extensions." Natural Computation, 2007. ICNC 2007. Third International Conference on. Vol. 2. IEEE, 2007. http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4344404 - Abe, Makoto. "Counting your customers one by one: A hierarchical Bayes extension to the Pareto/NBD model." Marketing Science 28.3 (2009): 541-553.

  • Pareto/NBD variant (HB) - Abe, Makoto. "Counting your customers one by one: A hierarchical Bayes extension to the Pareto/NBD model." Marketing Science 28.3 (2009): 541-553.

  • Pareto/GGG (HB) - Platzer, Michael, and Thomas Reutterer. forthcoming...

Copy Link

Version

Install

install.packages('BTYDplus')

Monthly Downloads

139

Version

0.4.0

License

GPL-3

Maintainer

Michael Platzer

Last Published

January 21st, 2021

Functions in BTYDplus (0.4.0)

abe.mcmc.DrawParameters

HB Pareto/NBD variant as described in Abe (2009)
cbgcnbd.LL

Calculate the log-likelihood of the CBG/CNBD-k model
cbgcnbd.ConditionalExpectedTransactions

CBD/CNBD-k Conditional Expected Transactions
bgnbd.GenerateData

Simulate data according to BG/NBD model assumptions
cbgcnbd.Px

CBD/CNBD-k Unconditional Probability Distribution of Transactions
cbgcnbd.GenerateData

Simulate data according to CBG/CNBD-k model assumptions
cbgcnbd.PAlive

CBG/CNBD-k P(alive)
cbgcnbd.cbs.LL

Calculate the log-likelihood of the CBG/CNBD-k model
abe.GenerateData

Generate artificial data which follows Abe's Pareto/NBD model variant.
cbgcnbd.EstimateParameters

Parameter Estimation for the CBG/CNBD-k model
cbgnbd.cbs.LL

Calculates the log-likelihood of the CBG/NBD model
cbgnbd.EstimateParameters

Parameter Estimation for the CBG/NBD model
cbgnbd.ConditionalExpectedTransactions

CBG/NBD Conditional Expected Transactions
cbgnbd.GenerateData

Simulate data according to CBG/NBD model assumptions
estimateRegularity

Estimate Regularity in Intertransaction Timings
elog2cbs

Faster implementation of BTYD::dc.ElogToCbsCbt that also returns summary statistic for estimating regularity
mcmc.setBurnin

(Re-)set burnin of MCMC chains.
ggnbd.cbs.LL

Calculate the log-likelihood of the Gamma/Gompertz/NBD model
ggnbd.ConditionalExpectedTransactions

Gamma/Gompertz/NBD Conditional Expected Transactions
nbd.cbs.LL

Calculate the log-likelihood of the NBD model
mcmc.DrawFutureTransactions

Samples number of future transactions based on drawn parameters
ggnbd.GenerateData

Simulate data according to Gamma/Gompertz/NBD model assumptions
mcmc.PActive

Calculates P(active) based on drawn future transactions.
pggg.mcmc.plotRegularityRateHeterogeneity

Pareto/GGG Plot Regularity Rate Heterogeneity
pnbd.mcmc.DrawParameters

Hierarchical Bayes variant of Pareto/NBD
ggnbd.EstimateParameters

Parameter Estimation for Gamma/Gompertz/NBD model
cbgnbd.PAlive

CBG/NBD P(alive)
cbgnbd.LL

Calculates the log-likelihood of the CBG/NBD model
mcmc.PAlive

Calculates P(alive) based on MCMC draws
mcmc.plotPActiveDiagnostic

Draw diagnostic plot to inspect error in P(active).
pggg.GenerateData

Generate artificial data which follows Pareto/GGG model assumptions
pggg.mcmc.DrawParameters

Hierarchical Bayes implementation of Pareto/GGG
nbd.EstimateParameters

Parameter Estimation for the NBD model
nbd.ConditionalExpectedTransactions

NBD Conditional Expected Transactions
nbd.GenerateData

Simulate data according to NBD model assumptions
ggnbd.PAlive

Gamma/Gompertz/NBD P(alive)
nbd.LL

Calculate the log-likelihood of the NBD model
ggnbd.LL

Calculate the log-likelihood of the Gamma/Gompertz/NBD model