Learn R Programming

ztpln (version 0.1.3)

dztplnm: The zero-truncated compund poisson-lognormal distributions mixture

Description

Density function and random generation for Zero-Truncated Poisson Lognormal distribution with parameters mu, sig, and theta.

Usage

dztplnm(x, mu, sig, theta, log = FALSE, type1 = TRUE)

rztplnm(n, mu, sig, theta, type1 = TRUE)

Value

dztplnm gives the (log) density and rztplnm generates random variates. function, qpois gives the quantile function, and rpois generates random deviates.

Arguments

x

vector of (non-negative integer) quantiles.

mu

vector of mean of lognormal distribution in sample.

sig

vector standard deviation of lognormal distribution in sample.

theta

vector of mixture weights

log

logical; if TRUE, probabilities p are given as log(p).

type1

logical; if TRUE, Use type 1 ztpln else use type 2.

n

number of random values to return.

Details

Type 1 ZTPLN truncates zero based on Poisson-lognormal distribution and type 2 ZTPLN truncates zero based on zero-truncated Poisson distribution. For mathematical details, please see vignette("ztpln")

See Also

dztpln

Examples

Run this code
rztplnm(n = 100, mu = c(0, 5), sig = c(1, 2), theta = c(0.2, 0.8))
dztplnm(x = 1:100, mu = c(0, 5), sig = c(1, 2), theta = c(0.2, 0.8))
dztplnm(x = 1:100, mu = c(0, 5), sig = c(1, 2), theta = c(0.2, 0.8), type1 = FALSE)

Run the code above in your browser using DataLab