mcmc.pmf | R Documentation |
Return the probability distribution of purchase frequencies for a random
customer in a given time period, i.e. P(X(t)=x)
. This is estimated by
generating sample_size
number of random customers that follow the
provided parameter draws. Due to this sampling, the return result varies from
one call to another.
mcmc.pmf(draws, t, x, sample_size = 10000, covariates = NULL)
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. |
x |
Number of transactions for which probability is calculated. May also be a vector. |
sample_size |
Sample size for estimating the probability distribution. |
covariates |
(optional) Matrix of covariates, for Pareto/NBD (Abe)
model, passed to |
P(X(t)=x)
. If either t
or x
is a vector, then the
output will be a vector as well. If both are vectors, the output will be a
matrix.
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.pmf(param.draws, t = c(26, 52), x = 0:6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.