shiftedBetaGeometric: Shifted Beta-geometric (sbg) Distribution Family Function

shiftedBetaGeometricR Documentation

Shifted Beta-geometric (sbg) Distribution Family Function

Description

Provides functions for the probability mass function (PMF), cumulative distribution function (CDF), quantile function, and random variate generation for the SBG distribution.

Usage

dsbg(x, shape1, shape2, log = FALSE)
psbg(x, shape1, shape2, lower.tail = TRUE, log.p = FALSE)
qsbg(p, shape1, shape2, lower.tail = TRUE, log.p = FALSE)
rsbg(n, shape1, shape2)

Arguments

x

Vector of non-negative integers for dsbg and psbg.

p

Vector of probabilities (0 <= p <= 1) for qsbg.

n

Number of random variates to generate for rsbg.

shape1

First shape parameter "a" (must be > 0).

shape2

Second shape parameter "b" (must be > 0).

log

Logical; if TRUE, probabilities are returned on the log scale (for dsbg and psbg).

lower.tail

Logical; if TRUE (default), probabilities are P(X <= x), otherwise P(X > x) (for psbg).

log.p

Logical; if TRUE, probabilities are returned on the log scale (for psbg and qsbg).

Details

The Shifted Beta Geometric distribution with two shape parameters shape1 (a) and shape2 (b) has the following CDF:

1- Beta(a,b+x)/Beta(a,b)

For x= 1,2,3,...,n and a > 0 and b > 0.

The Shifted Beta Geometric (sBG) distribution, is a probability mixture model of Beta and Geometric distributions. sBG was introduced by Fader and Hardie, models customer retention by assuming that individuals have heterogeneous dropout probabilities. These probabilities are drawn from a Beta distribution, and each customer's retention follows a geometric process. This combination captures variability in churn behavior across a population, making it well-suited for analyzing survival data, customer lifetime and retention data.

Value

  • dsbg: A numeric vector of PMF values.

  • psbg: A numeric vector of CDF values.

  • qsbg: A numeric vector of quantile values.

  • rsbg: A numeric vector of random variates.

References

Fader P, Hardie B. How to project customer retention. Journal of Interactive Marketing. 2007;21(1):76-90.

Fader P, Hardie B, Liu Y, Davin J, Steenburgh T. "How to Project Customer Retention" Revisited: The Role of Duration Dependence. Journal of Interactive Marketing. 2018;43:1-16.

Examples

# PMF example
dsbg(1:5, shape1 = 2, shape2 = 3)

# CDF example
psbg(1:5, shape1 = 2, shape2 = 3)

# Quantile example
qsbg(c(0.1, 0.5, 0.9), shape1 = 2, shape2 = 3)

# Random variates
rsbg(10, shape1 = 2, shape2 = 3)


sriharitn/foretell documentation built on Feb. 2, 2025, 10:25 a.m.