shiftedBetaGeometric | R Documentation |
Provides functions for the probability mass function (PMF), cumulative distribution function (CDF), quantile function, and random variate generation for the SBG distribution.
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)
x |
Vector of non-negative integers for |
p |
Vector of probabilities (0 <= p <= 1) for |
n |
Number of random variates to generate for |
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 |
lower.tail |
Logical; if TRUE (default), probabilities are P(X <= x), otherwise P(X > x) (for |
log.p |
Logical; if TRUE, probabilities are returned on the log scale (for |
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.
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.
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.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.