cfN_Waring: Characteristic function of the Waring distribution

View source: R/cfN_Waring.R

cfN_WaringR Documentation

Characteristic function of the Waring distribution

Description

cfN_Waring(t,a,b,r) evaluates the characteristic function cf(t) of the Waring distribution, with the parameters a (a > 0), b (b > 0), and r (r > 0), i.e.

cf(t) = cfN_Waring(t,a,b,r) = ((gamma(a+r)*gamma(a+b)) / (gamma(a)*gamma(a+b+r)))* 2F1(r,b,a+b+r,e^(1i*t)); where 2F1 denotes the Gauss hypergeometric function. The Waring distribution is also known as beta negative binomial distribution. For more details see [4], p. 643

Usage

cfN_Waring(t, a, b, r, cfX)

Arguments

t

vector or array of real values, where the CF is evaluated

a

vector of the 'shape' parameters a > 0. If empty, default value is a = 1.

b

vector of the 'shape' parameters b > 0. If empty, default value is b = 1.

r

number of successes until the experiment is stopped (integer but can be extended to real).

cfX

function.

Value

Characteristic function cf(t) of the Waring distribution.

Note

Ver.: 31-Jul-2021 12:47:54 (consistent with Matlab CharFunTool v1.5.1, 15-Nov-2016 13:36:26).

References

[1] WITKOVSKY V., WIMMER G., DUBY T. (2016). Computing the aggregate loss distribution based on numerical inversion of the compound empirical characteristic function of frequency and severity. Preprint submitted to Insurance: Mathematics and Economics.

[2] DUBY T., WIMMER G., WITKOVSKY V.(2016). MATLAB toolbox CRM for computing distributions of collective risk models. Preprint submitted to Journal of Statistical Software.

[3] WITKOVSKY V. (2016). Numerical inversion of a characteristic function: An alternative tool to form the probability distribution of output quantity in linear measurement models. Acta IMEKO, 5(3), 32-44.

[4] WIMMER G., ALTMANN G. (1999). Thesaurus of univariate discrete probability distributions. STAMM Verlag GmbH, Essen, Germany. ISBN 3-87773-025-6.

See Also

For more details see WIKIPEDIA: https://en.wikipedia.org/wiki/Beta_negative_binomial_distribution

Other Discrete Probability Distribution: cfN_Binomial(), cfN_Delaporte(), cfN_GeneralizedPoisson(), cfN_Geometric(), cfN_Logarithmic(), cfN_NegativeBinomial(), cfN_Poisson(), cfN_PolyaEggenberger(), cfN_Quinkert()

Examples

## EXAMPLE1
# CF of the Waring distribution with a = 2.2, b = 3.3, r = 4
# The CF is not computed correctly!! Because the hypergeomtric function
# Hypergeom2F1(r,b,a+b+r,z) does not converege abs(z)>=1. Here z = exp(1i*t),
# ans abs(exp(1i*t)) = 1.
 a <- 2.2
 b <- 3.3
 r <- 4
 t <- seq(from = -5,
               to = 5,
               length.out =1001)
 plotReIm(function(t)
         cfN_Waring(t, a, b, r),
         t,
         title = "CF of the Waring distribution with a = 2.2, b = 3.3, r = 4")



##EXAMPLE2
 #CF of the compound Waring-Exponential distribution
 a <- 2.2
 b <- 3.3
 r <- 4
 lambda <- 5
 cfX <- function(t)
         cfX_Exponential(t,lambda)
 t <- seq(-10,10,length.out = 501)
 plotReIm(function(t)
          cfN_Waring(t, a, b, r, cfX),
          t,
           title = "CF of the compound Waring-Exponential distribution")

##EXAMPLE3
# PDF/CDF of the compound Waring-Exponential distribution
  a <- 2.2
  b <- 3.3
  r <- 4
  lambda <- 5;
  cfX <- function(t)
          cfX_Exponential(t,lambda)
  cf <- function(t)
          cfN_Waring(t, a, b, r, cfX)
  x <- seq(0,35, length.out=  101)
  prob <- c(0.9, 0.95, 0.99)
  options <- list()
  options$isCompound = TRUE
  result <- cf2DistGP(cf,x,prob,options)

gajdosandrej/CharFunToolR documentation built on June 3, 2024, 7:46 p.m.