Learn R Programming

BTYDplus (version 0.7.2)

mcmc.pmf: Probability Mass Function for Pareto/GGG, Pareto/NBD (HB) and Pareto/NBD (Abe)

Description

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.

Usage

mcmc.pmf(draws, t, x, sample_size = 10000)

Arguments

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.

Value

\(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.

Details

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.

See Also

bgcnbd.pmf pnbd.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.pmf(param.draws, t = 52, x = 0:6)
mcmc.pmf(param.draws, t = c(26, 52), x = 0:6)
# }

Run the code above in your browser using DataLab