R/Examples/example_cfN_Poisson.R

Defines functions cf cfX cfX

## EXAMPLE1
# CF of the Poisson distribution with the parameter lambda = 10
lambda <- 10
t <- seq(-10, 10, length.out = 501)
plotReIm(function(t)
        cfN_Poisson(t, lambda), t,
        title = "CF of the Poisson distribution with the parameter lambda = 10")

## EXAMPLE2
# CF of the compound Poisson-Exponential distribution
lambda1 <- 10
lambda2 <- 5
cfX <- function(t)
        cfX_Exponential(t, lambda2)
t <- seq(-10, 10, length.out = 501)
plotReIm(function(t)
        cfN_Poisson(t, lambda1, cfX), t,
        title = "CF of the compound Poisson-Exponential distribution")

## EXAMPLE3
# PDF/CDF of the compound Poisson-Exponential distribution
lambda1 <- 10
lambda2 <- 5
cfX <- function(t)
        cfX_Exponential(t, lambda2)
cf <- function(t)
        cfN_Poisson(t, lambda1, cfX)
x <- seq(0, 8, 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.