Package {tpglp}


Type: Package
Title: Three-Parameter Generalized Lindley-Poisson Distribution Functions
Version: 0.1.0
Description: Provides functions for random generation, density, cumulative distribution, quantile function, moments, and log-likelihood for a three-parameter generalized Lindley-Poisson mixture model.
License: GPL-3
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: stats
NeedsCompilation: no
Packaged: 2026-05-29 01:51:18 UTC; nisan
Author: Nisansala Wijerathna [aut, cre], DiangLiang Deng [ths]
Maintainer: Nisansala Wijerathna <nisansaladulmini32@gmail.com>
Repository: CRAN
Date/Publication: 2026-06-02 07:50:08 UTC

Density Function of the Three-Parameter Generalized Lindley-Poisson Distribution

Description

Computes the probability mass function of the Three-Parameter Generalized Lindley-Poisson distribution.

Usage

dtpglp(y, pi, theta1, theta2, log = FALSE)

Arguments

y

Numeric vector of non-negative integers.

pi

Numeric. Mixing probability in [0,1].

theta1

Numeric. Positive parameter.

theta2

Numeric. Positive parameter.

log

Logical. If TRUE, returns log-probabilities.

Value

Numeric vector of probabilities.

Examples

dtpglp(0:5, pi = 0.6, theta1 = 1, theta2 = 2)


Log-Likelihood Function for the Three-Parameter Generalized Lindley-Poisson Distribution

Description

Computes the log-likelihood.

Usage

logLik_tpglp(y, pi, theta1, theta2)

Arguments

y

Numeric vector of counts.

pi

Numeric. Mixing probability.

theta1

Numeric. Positive parameter.

theta2

Numeric. Positive parameter.

Value

Numeric value.

Examples

y <- rpois(100, 2)
logLik_tpglp(y, pi = 0.5, theta1 = 1, theta2 = 2)


Mean of the Three-Parameter Generalized Lindley-Poisson Distribution

Description

Computes the mean.

Usage

mean_tpglp(pi, theta1, theta2)

Arguments

pi

Numeric. Mixing probability.

theta1

Numeric. Positive parameter.

theta2

Numeric. Positive parameter.

Value

Numeric value.

Examples

mean_tpglp(pi = 0.6, theta1 = 1, theta2 = 2)


Distribution Function of the Three-Parameter Generalized Lindley-Poisson Distribution

Description

Computes cumulative probabilities.

Usage

ptpglp(q, pi, theta1, theta2, lower.tail = TRUE)

Arguments

q

Numeric vector of quantiles.

pi

Numeric. Mixing probability in [0,1].

theta1

Numeric. Positive parameter.

theta2

Numeric. Positive parameter.

lower.tail

Logical.

Value

Numeric vector of probabilities.

Examples

ptpglp(5, pi = 0.6, theta1 = 1, theta2 = 2)


Quantile Function of the Three-Parameter Generalized Lindley-Poisson Distribution

Description

Computes quantiles numerically via inversion.

Usage

qtpglp(p, pi, theta1, theta2, max_y = 1000, lower.tail = TRUE)

Arguments

p

Numeric vector of probabilities.

pi

Numeric. Mixing probability.

theta1

Numeric. Positive parameter.

theta2

Numeric. Positive parameter.

max_y

Integer search limit.

lower.tail

Logical.

Value

Numeric vector of quantiles.

Examples

qtpglp(0.5, pi = 0.6, theta1 = 1, theta2 = 2)


Random Generation from the Three-Parameter Generalized Lindley-Poisson Distribution

Description

Generates random observations from a two-component mixture model: an Exponential-Poisson (geometric) component and a Gamma-Poisson (negative binomial) component.

Usage

rtpglp(n, pi, theta1, theta2, seed = NULL)

Arguments

n

number of observations

pi

mixing probability

theta1

positive parameter

theta2

positive parameter

seed

optional seed

Details

For each observation:

Value

vector of counts

Examples

rtpglp(100, pi = 0.6, theta1 = 1, theta2 = 2)
rtpglp(100, pi = 0.6, theta1 = 1, theta2 = 2, seed = 123)


Variance of the Three-Parameter Generalized Lindley-Poisson Distribution

Description

Computes the variance.

Usage

var_tpglp(pi, theta1, theta2)

Arguments

pi

Numeric. Mixing probability.

theta1

Numeric. Positive parameter.

theta2

Numeric. Positive parameter.

Value

Numeric value.

Examples

var_tpglp(pi = 0.6, theta1 = 1, theta2 = 2)