Calculate P(X(t)=x), the probability to make exactly x repeat transactions in the interval (0, t]. This interval is in the estimation period and excludes values of t=0. Note that here t is defined as the observation period T.cal which differs by customer.

# S4 method for clv.fitted.transactions
pmf(object, x = 0:5)

## Arguments

object

The fitted transaction model.

x

Vector of positive integer numbers (>=0) indicating the number of repeat transactions x for which the PMF should be calculated.

## Value

Returns a data.table with ids and depending on x, multiple columns of PMF values, each column for one value in x.

Id

customer identification

pmf.x.Y

PMF values for Y number of transactions

The model fitting functions pnbd, bgnbd, ggomnbd.

plot to visually compare the PMF values against actuals.

## Examples

# \donttest{
data("cdnow")

# Fit the ParetoNBD model on the CDnow data
pnbd.cdnow <- pnbd(clvdata(cdnow, time.unit="w",
estimation.split=37,
date.format="ymd"))
#> Starting estimation...
#> Estimation finished!

# Calculate the PMF for 0 to 10 transactions
#  in the estimation period
pmf(pnbd.cdnow, x=0:10)
#>         Id   pmf.x.0   pmf.x.1    pmf.x.2    pmf.x.3    pmf.x.4    pmf.x.5
#>    1:    1 0.6015503 0.1657156 0.08155493 0.04792002 0.03064000 0.02056505
#>    2:   10 0.6015503 0.1657156 0.08155493 0.04792002 0.03064000 0.02056505
#>    3:  100 0.6026941 0.1659529 0.08154711 0.04781471 0.03049773 0.02041476
#>    4: 1000 0.6134591 0.1679575 0.08125268 0.04665739 0.02905366 0.01894890
#>    5: 1001 0.6134591 0.1679575 0.08125268 0.04665739 0.02905366 0.01894890
#>   ---
#> 2353:  995 0.6134591 0.1679575 0.08125268 0.04665739 0.02905366 0.01894890
#> 2354:  996 0.6134591 0.1679575 0.08125268 0.04665739 0.02905366 0.01894890
#> 2355:  997 0.6134591 0.1679575 0.08125268 0.04665739 0.02905366 0.01894890
#> 2356:  998 0.6134591 0.1679575 0.08125268 0.04665739 0.02905366 0.01894890
#> 2357:  999 0.6134591 0.1679575 0.08125268 0.04665739 0.02905366 0.01894890
#>          pmf.x.6     pmf.x.7     pmf.x.8     pmf.x.9    pmf.x.10
#>    1: 0.01423779 0.010069592 0.007232370 0.005255241 0.003853191
#>    2: 0.01423779 0.010069592 0.007232370 0.005255241 0.003853191
#>    3: 0.01409371 0.009938364 0.007116532 0.005155115 0.003767935
#>    4: 0.01272869 0.008725213 0.006069147 0.004268411 0.003027769
#>    5: 0.01272869 0.008725213 0.006069147 0.004268411 0.003027769
#>   ---
#> 2353: 0.01272869 0.008725213 0.006069147 0.004268411 0.003027769
#> 2354: 0.01272869 0.008725213 0.006069147 0.004268411 0.003027769
#> 2355: 0.01272869 0.008725213 0.006069147 0.004268411 0.003027769
#> 2356: 0.01272869 0.008725213 0.006069147 0.004268411 0.003027769
#> 2357: 0.01272869 0.008725213 0.006069147 0.004268411 0.003027769

# Compare vs. actuals (CBS in estimation period):
# x    mean(pmf)    actual percentage of x
# 0    0.616514     1432/2357= 0.6075519
# 1    0.168309     436/2357 = 0.1849809
# 2    0.080971     208/2357 = 0.0882478
# 3    0.046190     100/2357 = 0.0424268
# 4    0.028566     60/2357  = 0.0254561
# 5    0.018506     36/2357  = 0.0152737
# 6    0.012351     27/2357  = 0.0114552
# 7    0.008415     21/2357  = 0.0089096
# 8    0.005822     5/2357   = 0.0021213
# 9    0.004074     4/2357   = 0.0016971
# 10   0.002877     7/2357   = 0.0029699
# }