Learn R Programming

new.dist (version 0.1.1)

wgd: Weighted Geometric Distribution

Description

Density, distribution function, quantile function and random generation for the Weighted Geometric distribution.

Usage

dwgd(x, alpha, lambda, log = FALSE)

pwgd(q, alpha, lambda, lower.tail = TRUE, log.p = FALSE)

qwgd(p, alpha, lambda, lower.tail = TRUE)

rwgd(n, alpha, lambda)

Value

dwgd gives the density, pwgd gives the distribution function, qwgd gives the quantile function and rwgd generates random deviates.

Arguments

x, q

vector of quantiles.

alpha, lambda

are parameters.

log, log.p

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

lower.tail

logical; if TRUE (default), probabilities are \(P\left[ X\leq x\right]\), otherwise, \(P\left[ X>x\right] \).

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Details

The Weighted Geometric distribution with parameters \(\alpha\) and \(\lambda\), has density $$f\left( x\right) =\frac{\left( 1-\alpha \right) \left( 1-\alpha ^{\lambda+1}\right) }{1-\alpha ^{\lambda }}\alpha ^{x-1} \left( 1-\alpha ^{\lambda x}\right),$$ where $$x\in \mathbb {N} =1,2,...~,~\lambda >0~and~0<\alpha <1.$$

References

Najarzadegan, H., Alamatsaz, M. H., Kazemi, I. ve Kundu, D., 2020, Weighted bivariate geometric distribution: Simulation and estimation, Communications in Statistics-Simulation and Computation, 49 (9), 2419-2443.

Examples

Run this code
library(new.dist)
dwgd(1,alpha=.2,lambda=3)
pwgd(1,alpha=.2,lambda=3)
qwgd(.98,alpha=.2,lambda=3)
rwgd(10,alpha=.2,lambda=3)

Run the code above in your browser using DataLab