cfN_Binomial(t, n, p, cfX) evaluates the compound characteristic function cf(t) = cfN_Binomial(-1i*log(cfX(t)), n, p), where cfX is function handle of the characteristic function cfX(t) of a continuous distribution and/or random variable X.
Note that such CF is characteristic function of the compound distribution, i.e. distribution of the random variable Y = X_1 + ... + X_N, where X_i ~ F_X are i.i.d. random variables with common CF cfX(t), and N ~ F_N is independent RV with its CF given by cfN(t).
cfN_Binomial(t, n = 10, p = 1/2, cfX)
Other Discrete Probability Distribution: cfN_Delaporte
,
cfN_GeneralizedPoisson
,
cfN_Geometric
,
cfN_Logarithmic
,
cfN_NegativeBinomial
,
cfN_Poisson
,
cfN_PolyaEggenberger
## EXAMPLE1 (CF of the Binomial distribution with n = 25, p = 0.3)
n <- 25
p <- 0.3
t <- seq(-15, 15, length.out = 1001)
plotGraf(function(t)
cfN_Binomial(t, n, p), t, title = "CF of the Binomial distribution with n = 25, p = 0.3")
## EXAMPLE2 (CF of the compound Binomial-Exponential distribution)
n <- 25
p <- 0.3
lambda <- 10
cfX <- function(t)
cfX_Exponential(t, lambda)
t <- seq(-10, 10, length.out = 501)
plotGraf(function(t)
cfN_Binomial(t, n, p, cfX), t, title = "CF of the compound Binomial-Exponential distribution")
## EXAMPLE3 (PDF/CDF of the compound Binomial-Exponential distribution)
n <- 25
p <- 0.3
lambda <- 5
cfX <- function(t)
cfX_Exponential(t, lambda)
cf <- function(t)
cfN_Binomial(t, n, p, cfX)
x <- seq(0, 5, length.out = 101)
prob <- c(0.9, 0.95, 0.99)
result <- cf2DistGP(cf, x, prob, isCompound = TRUE)
Run the code above in your browser using DataLab