Calculates the Log-Likelihood values for the Pareto/NBD model with and without covariates.
The function pnbd_nocov_LL_ind
calculates the individual LogLikelihood
values for each customer for the given parameters.
The function pnbd_nocov_LL_sum
calculates the LogLikelihood value summed
across customers for the given parameters.
The function pnbd_staticcov_LL_ind
calculates the individual LogLikelihood
values for each customer for the given parameters and covariates.
The function pnbd_staticcov_LL_sum
calculates the individual LogLikelihood values summed
across customers.
pnbd_nocov_LL_ind(vLogparams, vX, vT_x, vT_cal)pnbd_nocov_LL_sum(vLogparams, vX, vT_x, vT_cal)
pnbd_staticcov_LL_ind(vParams, vX, vT_x, vT_cal, mCov_life, mCov_trans)
pnbd_staticcov_LL_sum(vParams, vX, vT_x, vT_cal, mCov_life, mCov_trans)
vector with the Pareto/NBD model parameters log scaled. See Details.
Frequency vector of length n counting the numbers of purchases.
Recency vector of length n.
Vector of length n indicating the total number of periods of observation.
vector with the parameters for the Pareto/NBD model and the static covariates. See Details.
Matrix containing the covariates data affecting the lifetime process. One column for each covariate.
Matrix containing the covariates data affecting the transaction process. One column for each covariate.
Returns the respective Log-Likelihood value(s) for the Pareto/NBD model with or without covariates.
r, alpha_0, s, beta_0
are the model parameters used for estimation.
s: shape parameter of the Gamma distribution for the lifetime process.
The smaller s, the stronger the heterogeneity of customer lifetimes.
beta: scale parameter for the Gamma distribution for the lifetime process.
r: shape parameter of the Gamma distribution of the purchase process.
The smaller r, the stronger the heterogeneity of the purchase process.
alpha: scale parameter of the Gamma distribution of the purchase process.
vParams
is vector with the Pareto/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_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 vParams
at the respective position.
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 vParams
at the respective position.
Fader, Peter S., and Bruce G.S. Hardie (2005). "A Note on Deriving the Pareto/NBD Model and Related Expressions.", Web. http://www.brucehardie.com/notes/008/.