Learn R Programming

BTYDplus (version 0.7.2)

mcmc.Expectation: 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

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.

Value

Number of repeat transactions a customer is expected to make in a time period of length t.

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.

See Also

bgcnbd.Expectation mcmc.pmf

Examples

Run this code
# NOT RUN {
cbs <- cdnow.sample()$cbs # load CDNow summary data
param.draws <- pnbd.mcmc.DrawParameters(cbs, 
  mcmc = 200, burnin = 100, thin = 20, chains = 1) # short MCMC runs for demo purposes
mcmc.Expectation(param.draws, t = c(26, 52))
# }

Run the code above in your browser using DataLab