bgnbd.EstimateParameters {BTYD}R Documentation

BG/NBD Parameter Estimation


Estimates parameters for the BG/NBD model.


  par.start = c(1, 3, 1, 3),
  max.param.value = 10000,
  method = "L-BFGS-B",
  hessian = FALSE


calibration period CBS (customer by sufficient statistic). It must contain columns for frequency ("x"), recency ("t.x"), and total time observed (""). Note that recency must be the time between the start of the calibration period and the customer's last transaction, not the time between the customer's last transaction and the end of the calibration period.


initial BG/NBD parameters - a vector with r, alpha, a, and b, in that order. r and alpha are unobserved parameters for the NBD transaction process. a and b are unobserved parameters for the Beta geometric dropout process.


the upper bound on parameters.


the optimization method(s) passed along to optimx.


set it to TRUE if you want the Hessian matrix, and then you might as well have the complete optimx object returned.


The best-fitting parameters are determined using the function. The sum of the log-likelihood for each customer (for a set of parameters) is maximized in order to estimate parameters.

A set of starting parameters must be provided for this method. If no parameters are provided, (1,3,1,3) is used as a default. These values are used because they provide good convergence across data sets. It may be useful to use starting values for r and alpha that represent your best guess of the heterogeneity in the buy and die rate of customers. It may be necessary to run the estimation from multiple starting points to ensure that it converges. To compare the log-likelihoods of different parameters, use

The lower bound on the parameters to be estimated is always zero, since BG/NBD parameters cannot be negative. The upper bound can be set with the max.param.value parameter.

This function may take some time to run.


Vector of estimated parameters.


Fader, Peter S.; Hardie, and Bruce G.S.. "Overcoming the BG/NBD Model's #NUM! Error Problem." December. 2013. Web.

See Also


data(cdnowSummary) <- cdnowSummary$cbs
# already has column names required by method

# starting-point parameters
startingparams <- c(1.0, 3, 1.0, 3)

# estimated parameters
est.params <- bgnbd.EstimateParameters( =,
                                       par.start = startingparams)

# complete object returned by \code{\link[optimx]{optimx}}
optimx.set <- bgnbd.EstimateParameters( =,
                                       par.start = startingparams,
                                       hessian = TRUE)

# log-likelihood of estimated parameters,

[Package BTYD version 2.4.3 Index]