Learn R Programming

NeuDist (version 1.0.1)

NewLindleyHC: New Lindley Half-Cauchy Distribution

Description

Provides density, distribution, quantile, random generation, and hazard functions for the New Lindley Half-Cauchy distribution.

Usage

dNLindley.HC(x, lambda, theta, log = FALSE)
pNLindley.HC(q, lambda, theta, lower.tail = TRUE, log.p = FALSE)
qNLindley.HC(p, lambda, theta, lower.tail = TRUE, log.p = FALSE)
rNLindley.HC(n, lambda, theta)
hNLindley.HC(x, lambda, theta)

Value

  • dNLindley.HC: numeric vector of (log-)densities

  • pNLindley.HC: numeric vector of probabilities

  • qNLindley.HC: numeric vector of quantiles

  • rNLindley.HC: numeric vector of random variates

  • hNLindley.HC: numeric vector of hazard values

Arguments

x, q

numeric vector of quantiles (x, q)

lambda

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 New Lindley Half-Cauchy distribution is parameterized by the parameters \(\lambda > 0\), and \(\theta > 0\).

The New Lindley Half-Cauchy distribution has CDF:

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

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

The following functions are included:

  • dNLindley.HC() — Density function

  • pNLindley.HC() — Distribution function

  • qNLindley.HC() — Quantile function

  • rNLindley.HC() — Random generation

  • hNLindley.HC() — Hazard function

References

Chaudhary, A.K. & Kumar, V. (2020). New Lindley Half Cauchy Distribution: Theory and Applications. International Journal of Recent Technology and Engineering (IJRTE), 9(4), 1--7. tools:::Rd_expr_doi("10.35940/ijrte.D4734.119420")

Examples

Run this code
x <- seq(1, 10, 0.5)
dNLindley.HC(x, 0.5, 1.5)
pNLindley.HC(x, 0.5, 1.5)
qNLindley.HC(0.5, 0.5, 1.5)
rNLindley.HC(10, 0.5, 1.5)
hNLindley.HC(x, 0.5, 1.5)

# Data
x <- reactorpump
# ML estimates
params = list(lambda=0.7743, theta=1.3829)
#P–P (probability–probability) plot
pp.plot(x, params = params, pfun = pNLindley.HC, fit.line=TRUE)

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

# Goodness-of-Fit(GoF) and Model Diagnostics 
out <- gofic(x, params = params,
             dfun = dNLindley.HC, pfun=pNLindley.HC, plot=TRUE)
print.gofic(out)

Run the code above in your browser using DataLab