pggg.mcmc.DrawParameters {BTYDplus} | R Documentation |
Pareto/GGG Parameter Draws
Description
Returns draws from the posterior distributions of the Pareto/GGG parameters, on cohort as well as on customer level.
Usage
pggg.mcmc.DrawParameters(
cal.cbs,
mcmc = 2500,
burnin = 500,
thin = 50,
chains = 2,
mc.cores = NULL,
param_init = NULL,
trace = 100
)
Arguments
cal.cbs |
Calibration period customer-by-sufficient-statistic (CBS)
data.frame. It must contain a row for each customer, and columns |
mcmc |
Number of MCMC steps. |
burnin |
Number of initial MCMC steps which are discarded. |
thin |
Only every |
chains |
Number of MCMC chains to be run. |
mc.cores |
Number of cores to use in parallel (Unix only). Defaults to |
param_init |
List of start values for cohort-level parameters. |
trace |
Print logging statement every |
Details
See demo('pareto-ggg')
for how to apply this model.
Value
List of length 2:
level_1 |
list of |
level_2 |
|
References
Platzer, M., & Reutterer, T. (2016). Ticking away the moments: Timing regularity helps to better predict customer activity. Marketing Science, 35(5), 779-799. doi: 10.1287/mksc.2015.0963
See Also
pggg.GenerateData
mcmc.PAlive
mcmc.DrawFutureTransactions
Examples
data("groceryElog")
cbs <- elog2cbs(groceryElog, T.cal = "2006-12-31")
param.draws <- pggg.mcmc.DrawParameters(cbs,
mcmc = 20, burnin = 10, thin = 2, chains = 1) # short MCMC to run demo fast
# cohort-level parameter draws
as.matrix(param.draws$level_2)
# customer-level parameter draws for customer with ID '4'
as.matrix(param.draws$level_1[["4"]])
# estimate future transactions
xstar.draws <- mcmc.DrawFutureTransactions(cbs, param.draws, cbs$T.star)
xstar.est <- apply(xstar.draws, 2, mean)
head(xstar.est)