mcmc.Expectation | R Documentation |
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))
.
mcmc.Expectation(draws, t, sample_size = 10000)
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. |
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.
Number of repeat transactions a customer is expected to make in a time period of length t.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.