mcmc.Expectation {BTYDplus} | R Documentation |
Unconditional Expectation for Pareto/GGG, Pareto/NBD (HB) and Pareto/NBD (Abe)
Description
Uses model parameter draws to return the expected number of repeat transactions that a randomly chosen customer (for whom we have no prior information) is expected to make in a given time period.
E(X(t))
.
Usage
mcmc.Expectation(draws, t, sample_size = 10000)
Arguments
draws |
MCMC draws as returned by |
t |
Length of time for which we are calculating the expected number of transactions. May also be a vector. |
sample_size |
Sample size for estimating the probability distribution. |
Details
The expected transactions need to be sampled. Due to this sampling, the
return result varies from one call to another. Larger values of
sample_size
will generate more stable results.
Value
Number of repeat transactions a customer is expected to make in a time period of length t.
Examples
data("groceryElog")
cbs <- elog2cbs(groceryElog)
param.draws <- pnbd.mcmc.DrawParameters(cbs,
mcmc = 100, burnin = 50, thin = 10, chains = 1) # short MCMC to run demo fast
mcmc.Expectation(param.draws, t = c(26, 52))
[Package BTYDplus version 1.2.0 Index]