bgnbd_LL {CLVTools} | R Documentation |
BG/NBD: Log-Likelihood functions
Description
Calculates the Log-Likelihood values for the BG/NBD model with and without covariates.
The function bgnbd_nocov_LL_ind
calculates the individual log-likelihood
values for each customer for the given parameters.
The function bgnbd_nocov_LL_sum
calculates the log-likelihood value summed
across customers for the given parameters.
The function bgnbd_staticcov_LL_ind
calculates the individual log-likelihood
values for each customer for the given parameters and covariates.
The function bgnbd_staticcov_LL_sum
calculates the individual log-likelihood values summed
across customers.
Usage
bgnbd_nocov_LL_ind(vLogparams, vX, vT_x, vT_cal)
bgnbd_nocov_LL_sum(vLogparams, vX, vT_x, vT_cal)
bgnbd_staticcov_LL_ind(vParams, vX, vT_x, vT_cal, mCov_life, mCov_trans)
bgnbd_staticcov_LL_sum(vParams, vX, vT_x, vT_cal, mCov_life, mCov_trans)
Arguments
vLogparams |
vector with the BG/NBD model parameters at log scale. See Details. |
vX |
Frequency vector of length n counting the numbers of purchases. |
vT_x |
Recency vector of length n. |
vT_cal |
Vector of length n indicating the total number of periods of observation. |
vParams |
vector with the parameters for the BG/NBD model at log scale and the static covariates at original scale. See Details. |
mCov_life |
Matrix containing the covariates data affecting the lifetime process. One column for each covariate. |
mCov_trans |
Matrix containing the covariates data affecting the transaction process. One column for each covariate. |
Details
vLogparams
is a vector with model parameters r, alpha_0, a, b
at log-scale, in this order.
vParams
is vector with the BG/NBD model parameters at log scale,
followed by the parameters for the lifetime covariates at original scale and then
followed by the parameters for the transaction covariates at original scale
mCov_trans
is a matrix containing the covariates data of
the time-invariant covariates that affect the transaction process.
Each column represents a different covariate. For every column a gamma parameter
needs to added to vLogparams
at the respective position.
mCov_life
is a matrix containing the covariates data of
the time-invariant covariates that affect the lifetime process.
Each column represents a different covariate. For every column a gamma parameter
needs to added to vLogparams
at the respective position.
Value
Returns the respective Log-Likelihood value(s) for the BG/NBD model with or without covariates.
References
Fader PS, Hardie BGS, Lee KL (2005). ““Counting Your Customers” the Easy Way: An Alternative to the Pareto/NBD Model” Marketing Science, 24(2), 275-284.
Fader PS, Hardie BGS (2013). “Overcoming the BG/NBD Model's #NUM! Error Problem” URL http://brucehardie.com/notes/027/bgnbd_num_error.pdf.
Fader PS, Hardie BGS (2007). “Incorporating time-invariant covariates into the Pareto/NBD and BG/NBD models.” URL http://www.brucehardie.com/notes/019/time_invariant_covariates.pdf.
Fader PS, Hardie BGS, Lee KL (2007). “Creating a Fit Histogram for the BG/NBD Model” URL https://www.brucehardie.com/notes/014/bgnbd_fit_histogram.pdf