Learn R Programming

NeuDist (version 1.0.1)

HCGenExp: Half-Cauchy Generalized Exponential(HCGE) Distribution

Description

Provides density, distribution, quantile, random generation, and hazard functions for the Half-Cauchy Generalized Exponential(HCGE) distribution.

Usage

dhc.gen.exp(x, alpha, lambda, theta, log = FALSE)
phc.gen.exp(q, alpha, lambda, theta, lower.tail = TRUE, log.p = FALSE)
qhc.gen.exp(p, alpha, lambda, theta, lower.tail = TRUE, log.p = FALSE)
rhc.gen.exp(n, alpha, lambda, theta)
hhc.gen.exp(x, alpha, lambda, theta)

Value

  • dhc.gen.exp: numeric vector of (log-)densities

  • phc.gen.exp: numeric vector of probabilities

  • qhc.gen.exp: numeric vector of quantiles

  • rhc.gen.exp: numeric vector of random variates

  • hhc.gen.exp: numeric vector of hazard values

Arguments

x, q

numeric vector of quantiles (x, q)

alpha

positive numeric parameter

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 HCGE distribution is parameterized by the parameters \(\alpha > 0\), \(\lambda > 0\), and \(\theta > 0\).

The HCGE distribution has CDF:

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

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

The implementation includes the following functions:

  • dhc.gen.exp() — Density function

  • phc.gen.exp() — Distribution function

  • qhc.gen.exp() — Quantile function

  • rhc.gen.exp() — Random generation

  • hhc.gen.exp() — Hazard function

References

Chaudhary, A.K., Sapkota, L.P. & Kumar, V. (2022). Half-Cauchy Generalized Exponential Distribution:Theory and Application. Journal of Nepal Mathematical Society (JNMS), 5(2), 1--10. tools:::Rd_expr_doi("10.3126/jnms.v5i2.50018")

Gupta, R. D., & Kundu, D. (1999). Generalized exponential distributions. Australian and New Zealand Journal of Statistics, 41(2), 173--188.

Examples

Run this code
x <- seq(0.1, 10, 0.2)
dhc.gen.exp(x, 2.0, 0.5, 0.1)
phc.gen.exp(x, 2.0, 0.5, 0.1)
qhc.gen.exp(0.5, 2.0, 0.5, 0.1)
rhc.gen.exp(10, 2.0, 0.5, 0.1)
hhc.gen.exp(x, 2.0, 0.5, 0.1)

# Data
x <- conductors
# ML estimates
params = list(alpha=6.6141, lambda=0.9352, theta=0.0103)
#P–P (probability–probability) plot
pp.plot(x, params = params, pfun = phc.gen.exp, fit.line=TRUE)

#Q-Q (quantile–quantile) plot 
qq.plot(x, params = params, qfun = qhc.gen.exp, fit.line=TRUE)

# Goodness-of-Fit(GoF) and Model Diagnostics 
res <- gofic(x, params = params,
             dfun = dhc.gen.exp, pfun=phc.gen.exp, plot=FALSE)
print.gofic(res)

Run the code above in your browser using DataLab