Learn R Programming

NeuDist (version 1.0.1)

LindleyRayleigh: Lindley-Rayleigh Distribution

Description

Provides density, distribution, quantile, random generation, and hazard functions for the Lindley-Rayleigh distribution.

Usage

dlindley.rlh(x, alpha, theta, log = FALSE)
plindley.rlh(q, alpha, theta, lower.tail = TRUE, log.p = FALSE)
qlindley.rlh(p, alpha, theta, lower.tail = TRUE, log.p = FALSE)
rlindley.rlh(n, alpha, theta)
hlindley.rlh(x, alpha, theta)

Value

  • dlindley.rlh: numeric vector of (log-)densities

  • plindley.rlh: numeric vector of probabilities

  • qlindley.rlh: numeric vector of quantiles

  • rlindley.rlh: numeric vector of random variates

  • hlindley.rlh: numeric vector of hazard values

Arguments

x, q

numeric vector of quantiles (x, q)

alpha

positive numeric parameter

theta

positive numeric parameter

log

logical; if TRUE, returns log-density

lower.tail

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

log.p

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

p

numeric vector of probabilities (0 < p < 1)

n

number of observations (integer > 0)

Details

The Lindley-Rayleigh distribution is parameterized by the parameters \(\alpha > 0\), and \(\theta > 0\).

The Lindley-Rayleigh distribution has CDF:

$$ F(x; \alpha, \theta) = \left[1-e^{-\alpha x^2}\right]^\theta\left\{1-\left(\frac{\theta} {1+\theta}\right) \ln \left(1-e^{-\alpha x^2}\right)\right\} \quad ;\;x > 0. $$

where\(\alpha\) and \(\theta\) are the parameters.

Included functions are:

  • dlindley.rlh() — Density function

  • plindley.rlh() — Distribution function

  • qlindley.rlh() — Quantile function

  • rlindley.rlh() — Random generation

  • hlindley.rlh() — Hazard function

References

Joshi, R. K., & Kumar, V. (2020). New Lindley-Rayleigh Distribution with Statistical properties and Applications. International Journal of Mathematics Trends and Technology (IJMTT), 66(9), 197--208. tools:::Rd_expr_doi("10.14445/22315373/IJMTT-V66I9P523")

Examples

Run this code
x <- seq(0.5, 5, 0.25)
dlindley.rlh(x, 0.25, 1.5)
plindley.rlh(x, 0.25, 1.5)
qlindley.rlh(0.75, 0.25, 1.5)
rlindley.rlh(10, 0.25, 1.5)
hlindley.rlh(x, 0.25, 1.5)

# Data
x <- rainfall
# ML estimates
params = list(alpha=0.2170, theta=1.2107)
#P–P (probability–probability) plot
pp.plot(x, params = params, pfun = plindley.rlh, fit.line=TRUE)

#Q-Q (quantile–quantile) plot 
qq.plot(x, params = params, qfun = qlindley.rlh, fit.line=TRUE)

# Goodness-of-Fit(GoF) and Model Diagnostics 
out <- gofic(x, params = params,
             dfun = dlindley.rlh, pfun=plindley.rlh, plot=FALSE)
print.gofic(out)

Run the code above in your browser using DataLab